Skip to content

Conversation

@francilioaraujo
Copy link

Issue #, if available

#3874

Description of changes

Added a new condition that converts managed policy names in intrinsic if values. I also had to refactor construct_role_for_resource to decrease the number of branches (the lines that build policies inside ifs).

Description of how you validated changes

Added tests to validate four cases:

  • When finding managed policy names in Policies
  • When finding an unknown policy name in Policies
  • When finding an intrinsic if, with a managed policy name as value if true and AWS::NoValue as value if false
  • When finding an intrinsic if, with AWS::NoValue as value if true and a managed policy name as value if false

Checklist

Examples?

Please reach out in the comments if you want to add an example. Examples will be
added to sam init through aws/aws-sam-cli-app-templates.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@francilioaraujo francilioaraujo requested a review from a team as a code owner January 24, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant