Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.1",
"version": "1.0.2-alpha.0",
"npmClient": "yarn",
"command": {
"publish": {
Expand Down
6 changes: 3 additions & 3 deletions packages/cdk-appconfig-examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/cdk-appconfig-handler-hello-world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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);

Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion packages/cdk-appconfig/lib/hosted_configuration_version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions packages/cdk-appconfig/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down