-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(IAM): Optimize IAM policy statements for size (#916)
* feat(IAM): Optimize IAM policy statements for size Attempts to reduce policy sizes by performing a number of optimizations: - `FnConcat` pre-concatenates string literals that are not tokens, to reduce rendered size - Redundant patterns in `Action` and `Resource` policy elements get de-duplicated (aka: `["iam:GetObject", "iam:Get*"]` becomes `["iam:Get*"]`, since this implies `"iam:GetObject"`) - Redundant statements get de-duplicated (if a statement offers strictly broader permissions than another one, then the later will be removed). - Statements that differ only in `Resource` content get merged (adding entries to the `Resource` element). IAM policy statements that have an `Sid` are not merged with anything (this could lead to the `Sid` mis-representing the statement's intention). They are also not de-duplicated (unless the other statement has the exact same `Sid`, which is likely symptom of a programming error). This causes widespread changes to the IAM policy documents (and some occurrences of `Fn::Join` intrinsic all over the place, so this commit is... massive). Generally speaking, this appears to make for smaller templates, which at least is not a bad thing. Fixes #924
- Loading branch information
1 parent
81b533c
commit 5996442
Showing
83 changed files
with
3,386 additions
and
2,748 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.