Skip to content

Commit

Permalink
fix(core): increase timeout for AcmCertificateImporter
Browse files Browse the repository at this point in the history
  • Loading branch information
ddneilson authored and jusiskin committed Jun 17, 2021
1 parent 64619c4 commit 435692f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/aws-rfdk/lib/core/lib/imported-acm-certificate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export class ImportedAcmCertificate extends Construct implements ICertificate {
layers: [ openSslLayer ],
retryAttempts: 0,
runtime: Runtime.NODEJS_12_X,
timeout: Duration.seconds(30),
timeout: Duration.minutes(5),
});

this.database.grantReadWriteData(lambda);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ export class AcmCertificateImporter extends DynamoBackedCustomResource {
const arn: string = resource.ARN;
let inUseByResources = [];
const backoffGenerator = new BackoffGenerator({
base: 200,
base: 1000,
jitterDivisor: 4,
maxAttempts,
maxIntervalMs: 30000,
});

do {
Expand All @@ -97,6 +98,7 @@ export class AcmCertificateImporter extends DynamoBackedCustomResource {
inUseByResources = cert!.InUseBy || [];

if (inUseByResources.length) {
console.log(`Sleeping -- Resource ${arn} in use by ${inUseByResources.join(', ')}`);
await backoffGenerator.backoff();
} else {
break;
Expand Down

0 comments on commit 435692f

Please sign in to comment.