Skip to content
Discussion options

You must be logged in to vote

Hi @EHadoux! This happens because AWS CDK's IAM policy synthesizer performs automatic statement minification: when multiple policy statements share the exact same Action and Effect, CDK merges their Resource arrays into a single statement to conserve IAM policy size limits.

When CloudFormation diffs the synthesized template, it sees a modification of the statement's Resource property, which cdk diff renders as a removal of the single-string resource and an addition of the combined array.

Here are the 3 clean ways to prevent this compaction and ensure cdk diff shows only green additions:


Solution 1: Assign Explicit Statement IDs (sid) (Recommended)

CDK's IAM deduplication pass will never …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@EHadoux
Comment options

Answer selected by EHadoux
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants