I am using aws CDK and need to register an IoT CA certificate to be used to sign device certificates. At the moment I am doing this manually AFTER the deployment using
aws iot register-ca-certificate \
--ca-certificate file://rootCA.pem \
--verification-cert file://verificationCert.pem
However, doing this manually for multiple stages/accounts sounds tedious. Can this be handeled within the cdk stack itself? In the documentation I only found the new iot.CfnCertificate()
class which can be used to declare a given X.509 certificate using a Ca certificate, but I would like to register a ca certificate itself.
CodePudding user response:
I believe the RegisterCaCertificate API has no CloudFormation (and therefore no CDK) equivalent.
CDK CustomResources are designed to fill such gaps in CloudFormation coverage. The AwsCustomResource construct is the Custom Resource flavour to choose when you simply need to execute an AWS SDK call during the deploy lifecycle, as in your case.