-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
@aws-cdk/aws-iamRelated to AWS Identity and Access ManagementRelated to AWS Identity and Access Managementfeature-requestA feature should be added or improved.A feature should be added or improved.needs-triageThis issue or PR still needs to be triaged.This issue or PR still needs to be triaged.
Description
Is there a way to create combined policy using CDK?
Use Case
I'm trying to import (AWS or customer) managed policies into a new managed policy. I couldn't find any info regarding how to do this.
This is needed to cope with size limitations (e.g. number of policies in a group).
Other
As a workaround I did this:
const myManagedPolicy = ...;
const myCombinedPolicy = new iam.ManagedPolicy(this, "MyCombinedPolicy", {
statements: myManagedPolicy.document.toJSON().Statement.map((s: any) => iam.PolicyStatement.fromJson(s))
});This works fine, but has two limitations:
- I can't assign any SID to the statements.
- It won't work with AWS managed policy (since they're of type
iam.IManagedPolicy)
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-iamRelated to AWS Identity and Access ManagementRelated to AWS Identity and Access Managementfeature-requestA feature should be added or improved.A feature should be added or improved.needs-triageThis issue or PR still needs to be triaged.This issue or PR still needs to be triaged.