You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the ACM client, I'm trying to wait for the certificateValidated state on a given certificate ARN using the following code in a lambda as part of a CloudFormation stack Custom resource. Occasionally, it returns immediately (~1 sec) while the certificate is still in the PENDING_VALIDATION state.
const acmClient = new AWS.ACM({ region: event.ResourceProperties.Region });
console.log(JSON.stringify(event));
if (event.RequestType !== 'Create') {
return cfnresponse.send(event, context, cfnresponse.SUCCESS);
} else {
var params = {
CertificateArn: event.ResourceProperties.CertificateArn
};
acmClient.waitFor('certificateValidated', params).promise()
.then(waitResult => {
console.log('waitResult:', JSON.stringify(waitResult));
let cert = waitResult.Certificate;
if (cert.Status !== 'ISSUED') {
return cfnresponse.send(event, context, cfnresponse.FAILED, { error: `Certificate was not validated. Current status is ${cert.Status}`, cert: cert });
} else {
return cfnresponse.send(event, context, cfnresponse.SUCCESS, { cert: cert});
}
})
.catch(waitError => {
console.log('waitError:', JSON.stringify(waitError));
return cfnresponse.send(event, context, cfnresponse.FAILED, waitError);
});
}
An example of the event lambda receives from a failure I just encountered:
Looking for some guidance on what may be causing this. There is a delay between the creation of the ACM Cert and calling waitFor, so I'm confident it's not that the resource isn't ready to be waited on.
The text was updated successfully, but these errors were encountered:
Greetings! We’re closing this issue because it has been open a long time and hasn’t been updated in a while and may not be getting the attention it deserves. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to comment or open a new issue.
Confirm by changing [ ] to [x] below:
Using the ACM client, I'm trying to wait for the
certificateValidated
state on a given certificate ARN using the following code in a lambda as part of a CloudFormation stack Custom resource. Occasionally, it returns immediately (~1 sec) while the certificate is still in thePENDING_VALIDATION
state.An example of the event lambda receives from a failure I just encountered:
The result returned from the
waitFor
call:Looking for some guidance on what may be causing this. There is a delay between the creation of the ACM Cert and calling
waitFor
, so I'm confident it's not that the resource isn't ready to be waited on.The text was updated successfully, but these errors were encountered: