1回答
- 新しい順
- 投票が多い順
- コメントが多い順
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 ;)
関連するコンテンツ
- AWS公式更新しました 1年前
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.