Skip to content
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

chore: Fix KeyError when accessing PolicyDocument #3522

Merged
merged 2 commits into from Feb 6, 2024

Conversation

jfuss
Copy link
Contributor

@jfuss jfuss commented Feb 6, 2024

If an intrinsic is within the Function.Policies Property, the d["PolicyDocument"] will fail because the valid policy is backed within the FN:If. Instead, we access PolicyDocument through a .get() call, which allows us to handle the intrinsic case.

Issue #, if available

None

Description of changes

See above

Description of how you validated changes

Wrote a test to validate the template is transformable.

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.

If an intrinsic is within the Function.Policies Property, the
`d["PolicyDocument"]` will fail because the valid policy is backed
within the `FN:If`. Instead, we access `PolicyDocument` through a
`.get()` call, which allows us to handle the intrinsic case.
@jfuss jfuss requested a review from a team as a code owner February 6, 2024 19:28
@jfuss jfuss merged commit e17dc8f into aws:develop Feb 6, 2024
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.

None yet

3 participants