New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unnecessary CodeDeployServiceRole created when template contains at least one enabled and one disabled DeploymentPreference #1496
Comments
Thank for reporting this issue! I agree that for |
We've got the same issue. We're passing a role to DeploymentPreference and SAM tries to create a CodeDeployServiceRole which isn't even used after the transformation. |
The fix for this is simple--it's only being busy which has kept me from fixing it for so long. Here's a pull request that solves the problem: #1662 |
We have the same issue even if the all Is there a tentative date when the fix will be available? |
What if you don't have any role assigned to the |
@hawflau has merged a fix. These changes will be pushed out in one of the coming releases. |
Would have been nice to see this in the changelog. Now that I'm here, I remember seeing this issue, but when the stack wanted to remove the role, we were a bit confused what's happening. |
The fix got released, and I was able to verify that the |
Hello, I'm currently experiencing the warning about this issue but all the |
@james-bellamy could you please elaborate more about this warning. Can you give me the steps to reproduce this issue. |
Hi, could someone enlighten me on what is the expected behavior when all |
Description:
I want to create a SAM template which uses a DeploymentPreference to specify how it should be deployed. However, I do not want SAM to create a CodeDeploy service role on my behalf--I want to provide a custom one. When I have at least one enabled DeploymentPreference, and at least one disabled DeploymentPreference in my template, the default CodeDeployServiceRole gets created in the 'translated' template, even if you provide your custom
Role
for every DeploymentPreference.It looks like this is happening because the
role
field on theDeploymentPreference
object isNone
for a disabled deployment preference, even when a role is provided. The disabled deployment preference is included in the list of deployment preferences that are considered incan_skip_service_role()
(https://github.com/awslabs/serverless-application-model/blob/develop/samtranslator/model/preferences/deployment_preference_collection.py#L73) even though maybe it shouldn't be.Steps to reproduce the issue:
Observed result:
The output template contains a resource called "CodeDeployServiceRole" which is not used anywhere
Expected result:'
The output template does not contain a resource called "CodeDeployServiceRole"
The text was updated successfully, but these errors were encountered: