1 Answer
- Newest
- Most votes
- Most comments
1
Hi gary,
There is no construct that accept an array of policies to attach to a principal, but, the beauty of CDK is that is programmatic, so that you can loop as
for (var i = 1, i<= N; i++) {
new iot.CfnPolicyPrincipalAttachment(this, "policy principal attachment " + i, {
policyName: "iot-policy-" + i,
principal: iotCertificate.attrArn,
});
}
Hope it helps ;)
Relevant content
- asked 9 months ago
- Accepted Answerasked 2 years ago
- asked a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated a year ago
Thanks alatech, my policy names are actually not incremental but that's ok, I can put them in an array and iterate through it. I only have 4 policies at them moment, so something to consider if things get bigger.