ARTICLE AD BOX
I'm trying to create CA in AWS IoT Core.
return new iot.CfnCACertificate(this.stack, id, { autoRegistrationStatus: args.autoRegistration === true ? 'ENABLE' : 'DISABLE', caCertificatePem: fs.readFileSync(filePath, 'utf-8'), certificateMode: args.accountType === 'Multi' ? 'SNI_ONLY' : 'DEFAULT', status: 'ACTIVE', tags: [ { key: 'Name', value: args.name, }, { key: 'Description', value: args.description, }, ], registrationConfig: { templateName: args.provisioningTemplateName, }, verificationCertificatePem: undefined, });Where under filePath I have my PEM. I can easily upload this PEM via Console. Unfortunately, this code returns an error:
1 validation error detected: Value 'Resource of type 'AWS::IoT::CACertificate' with identifier '-----BEGIN CERTIFICATE----- [Here is my PEM] -----END CERTIFICATE----- ' was not found.' at 'statusMessage' failed to satisfy constraint: Member must have length less than or equal to 2048Not sure why AWS is trying to search for CA instead of creating and why there is a 2048 limit on PEM size. How do I fix this?
