1 Respuesta
- Más nuevo
- Más votos
- Más comentarios
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 ;)
Contenido relevante
- OFICIAL DE AWSActualizada hace 8 meses
- OFICIAL DE AWSActualizada hace 3 años
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.