diff --git a/lerna.json b/lerna.json index 0883945..0163630 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.1", + "version": "1.0.2-alpha.0", "npmClient": "yarn", "command": { "publish": { diff --git a/packages/cdk-appconfig-examples/package.json b/packages/cdk-appconfig-examples/package.json index c080323..307910d 100644 --- a/packages/cdk-appconfig-examples/package.json +++ b/packages/cdk-appconfig-examples/package.json @@ -2,7 +2,7 @@ "name": "@cuperman/cdk-appconfig-examples", "description": "CDK examples for using AppConfig constructs", "license": "MIT", - "version": "1.0.1", + "version": "1.0.2-alpha.0", "author": { "name": "Jeff Cooper", "email": "jeff@cuperman.net" @@ -39,8 +39,8 @@ "typescript": "~3.9.7" }, "dependencies": { - "@cuperman/cdk-appconfig": "^1.0.1", - "@cuperman/cdk-appconfig-handler-hello-world": "^1.0.1", + "@cuperman/cdk-appconfig": "^1.0.2-alpha.0", + "@cuperman/cdk-appconfig-handler-hello-world": "^1.0.2-alpha.0", "aws-cdk-lib": "2.93.0", "constructs": "^10.0.0", "source-map-support": "^0.5.16" diff --git a/packages/cdk-appconfig-handler-hello-world/package.json b/packages/cdk-appconfig-handler-hello-world/package.json index ca1c21a..9c5df1c 100644 --- a/packages/cdk-appconfig-handler-hello-world/package.json +++ b/packages/cdk-appconfig-handler-hello-world/package.json @@ -2,7 +2,7 @@ "name": "@cuperman/cdk-appconfig-handler-hello-world", "description": "Custom resource handler for AppConfig lambda extension example", "license": "MIT", - "version": "1.0.1", + "version": "1.0.2-alpha.0", "author": { "name": "Jeff Cooper", "email": "jeff@cuperman.net" diff --git a/packages/cdk-appconfig-handler-hosted-configuration-version/index.js b/packages/cdk-appconfig-handler-hosted-configuration-version/index.js index eee9825..a931bfc 100644 --- a/packages/cdk-appconfig-handler-hosted-configuration-version/index.js +++ b/packages/cdk-appconfig-handler-hosted-configuration-version/index.js @@ -1,6 +1,10 @@ const S3 = require('aws-sdk/clients/s3'); const AppConfig = require('aws-sdk/clients/appconfig'); +const RETRY_MAX = 12; // retry up to 12 times if throttled +const RETRY_BASE_MS = 100; // increase delay exponentially with a base of 100ms +// note: retrying 12 times with base of 100ms may take up to 14 minutes in the worst case; set timeout accordingly + async function getContent(contentConfig) { console.log('getContent', contentConfig); @@ -15,7 +19,12 @@ async function getContent(contentConfig) { throw new Error(`ContentConfig requires either InlineContent or S3Location`); } - const s3 = new S3(); + const s3 = new S3({ + maxRetries: RETRY_MAX, + retryDelayOptions: { + base: RETRY_BASE_MS + } + }); const params = { Bucket: s3Location.BucketName, @@ -33,7 +42,12 @@ async function createConfigurationVersion(props) { console.log('createConfigurationVersion', props); const content = await getContent(props.ContentConfig); - const appconfig = new AppConfig(); + const appconfig = new AppConfig({ + maxRetries: RETRY_MAX, + retryDelayOptions: { + base: RETRY_BASE_MS + } + }); const params = { ApplicationId: props.ApplicationId, ConfigurationProfileId: props.ConfigurationProfileId, @@ -51,7 +65,12 @@ async function createConfigurationVersion(props) { async function deleteConfigurationVersion(physicalId, props) { console.log('deleteConfigurationVersion', props); - const appconfig = new AppConfig(); + const appconfig = new AppConfig({ + maxRetries: RETRY_MAX, + retryDelayOptions: { + base: RETRY_BASE_MS + } + }); const params = { ApplicationId: props.ApplicationId, ConfigurationProfileId: props.ConfigurationProfileId, diff --git a/packages/cdk-appconfig-handler-hosted-configuration-version/package.json b/packages/cdk-appconfig-handler-hosted-configuration-version/package.json index e703cbe..0667f97 100644 --- a/packages/cdk-appconfig-handler-hosted-configuration-version/package.json +++ b/packages/cdk-appconfig-handler-hosted-configuration-version/package.json @@ -2,7 +2,7 @@ "name": "@cuperman/cdk-appconfig-handler-hosted-configuration-version", "description": "Custom resource handler for AppConfig hosted configuration versions", "license": "MIT", - "version": "1.0.1", + "version": "1.0.2-alpha.0", "author": { "name": "Jeff Cooper", "email": "jeff@cuperman.net" diff --git a/packages/cdk-appconfig/lib/hosted_configuration_version.ts b/packages/cdk-appconfig/lib/hosted_configuration_version.ts index 20d7bf1..e54f7b2 100644 --- a/packages/cdk-appconfig/lib/hosted_configuration_version.ts +++ b/packages/cdk-appconfig/lib/hosted_configuration_version.ts @@ -61,7 +61,8 @@ export class HostedConfigurationVersion extends cdk.Resource implements IHostedC runtime: lambda.Runtime.NODEJS_18_X, code: lambda.Code.fromAsset(HANDLER_CODE_PATH), handler: 'index.onEvent', - uuid: 'c67842de-c9ed-4cbb-906f-3b490af456b8' + uuid: 'd9e6c544-62d9-4991-8587-c05873c14f91', + timeout: cdk.Duration.minutes(15) }); onEventHandler.addToRolePolicy( diff --git a/packages/cdk-appconfig/package.json b/packages/cdk-appconfig/package.json index 360d1c6..b63ee05 100644 --- a/packages/cdk-appconfig/package.json +++ b/packages/cdk-appconfig/package.json @@ -2,7 +2,7 @@ "name": "@cuperman/cdk-appconfig", "description": "High-level CDK Constructs for AWS AppConfig", "license": "MIT", - "version": "1.0.1", + "version": "1.0.2-alpha.0", "author": { "name": "Jeff Cooper", "email": "jeff@cuperman.net" @@ -39,7 +39,7 @@ "typescript": "~3.9.7" }, "dependencies": { - "@cuperman/cdk-appconfig-handler-hosted-configuration-version": "^1.0.1" + "@cuperman/cdk-appconfig-handler-hosted-configuration-version": "^1.0.2-alpha.0" }, "peerDependencies": { "aws-cdk-lib": "^2.93.0",