-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(iam): a composite principal is not efficiently synthesized for trust relationship #23765
Comments
I have the same issue when using this code, generates non-optimized trust policy:
this code, generates the optimized trust policy:
|
the main issue i had was with https://docs.aws.amazon.com/security-lake/latest/userguide/getting-started.html It enforces optimized, when trying to create the SecurityLake, the API returns this error:
|
python --version npx cdk version |
Same issue here. |
Cross posting for anyone picking this up: The logic for this should be implemented somewhere in |
This issues is already fixed via https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/cx-api/FEATURE_FLAGS.md#aws-cdkaws-iamminimizepolicies. |
Can confirm that this is working by having |
did not work for me: this CDK code:
generated this Trust Policy:
cdk.json
Am I doing anything wrong? |
{
"app": "python app.py",
"context": {
"@aws-cdk/aws-iam:minimizePolicies": true
}
} and it should be good! |
many thanks, that worked. wondering why CDK did not complain about the syntax issue in here is the minimized result just for the sake of completion.
|
If you want to set the context for an IAM construct or a stack in code, you can use Refer CDK context docs |
thank you, i will try those. it does not prevent closure of this ticket, the current solution is viable. |
Describe the bug
For our use case, we'd like to create a role in account X, and allow other AWS accounts to assume that role to read data from a bucket in account X.
Using typescript to provision the role in CDK, however, we have run into a character overflow issue with the trust policy under the trust relationships tab of the IAM role. Below is what we are told by AWS Support.
This bug is similar to #18774, which has been fixed. Apparently, the fix works for bucket policy and KMS key policy, but NOT for trust policy.
Expected Behavior
Current Behavior
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.60.0
Framework Version
No response
Node.js Version
v19.1.0
OS
mac 12.6.2
Language
Typescript
Language Version
typescript 4.9.4
Other information
No response
The text was updated successfully, but these errors were encountered: