1 Resposta
- Mais recentes
- Mais votos
- Mais comentários
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 ;)
Conteúdo relevante
- AWS OFICIALAtualizada há 2 anos
- AWS OFICIALAtualizada há um ano
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.