Skip to content

Convert managed policy names in intrinsic if values#3875

Merged
reedham-aws merged 8 commits intoaws:developfrom
francilioaraujo:develop
Feb 3, 2026
Merged

Convert managed policy names in intrinsic if values#3875
reedham-aws merged 8 commits intoaws:developfrom
francilioaraujo:develop

Conversation

@francilioaraujo
Copy link
Contributor

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
@reedham-aws reedham-aws enabled auto-merge (squash) February 3, 2026 17:42
@reedham-aws reedham-aws merged commit 04ab7c8 into aws:develop Feb 3, 2026
7 checks passed
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.

3 participants