Skip to content

Commit 225d261

Browse files
authored
feat(appconfig): add atDeploymentTick extension action point to L2 Constructs (#32490)
### Issue # (if applicable) Not Applicable ### Reason for this change Missing feature for AppConfig Extension Action Point ### Description of changes Added feature and unit tests. Updated Integration tests. ### Description of how you validated changes Unit tests and integ tests ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 5e73dd0 commit 225d261

16 files changed

+193
-37
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.extension.js.snapshot/aws-appconfig-extension.assets.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.extension.js.snapshot/aws-appconfig-extension.template.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,23 @@
318318
]
319319
}
320320
}
321+
],
322+
"AT_DEPLOYMENT_TICK": [
323+
{
324+
"Name": "awsappconfigextension-MyLambdaExtension-68C15290-0",
325+
"Uri": {
326+
"Fn::GetAtt": [
327+
"MyFunction3BAA72D1",
328+
"Arn"
329+
]
330+
},
331+
"RoleArn": {
332+
"Fn::GetAtt": [
333+
"MyLambdaExtensionRoleBC958D3F13B04",
334+
"Arn"
335+
]
336+
}
337+
}
321338
]
322339
},
323340
"Name": "awsappconfigextension-MyLambdaExtension-68C15290"

packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.extension.js.snapshot/awsappconfigextensionMyApplicationappconfigextensionDefaultTestDeployAssert64BA6C4E.assets.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.extension.js.snapshot/cdk.out

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.extension.js.snapshot/integ.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.extension.js.snapshot/manifest.json

Lines changed: 2 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.extension.js.snapshot/tree.json

Lines changed: 27 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-appconfig/test/integ.extension.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const lambdaExtension = new Extension(stack, 'MyLambdaExtension', {
3939
actionPoints: [
4040
ActionPoint.PRE_CREATE_HOSTED_CONFIGURATION_VERSION,
4141
ActionPoint.ON_DEPLOYMENT_START,
42+
ActionPoint.AT_DEPLOYMENT_TICK,
4243
],
4344
eventDestination: new LambdaDestination(lambda),
4445
}),

packages/aws-cdk-lib/aws-appconfig/README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,9 +536,22 @@ new appconfig.SourcedConfiguration(this, 'MySourcedConfiguration', {
536536
## Extension
537537

538538
An extension augments your ability to inject logic or behavior at different points during the AWS AppConfig workflow of
539-
creating or deploying a configuration.
539+
creating or deploying a configuration. You can associate these types of tasks with AWS AppConfig applications, environments, and configuration profiles.
540540
See: https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html
541541

542+
An extension defines one or more actions, that it performs during an AWS AppConfig workflow. Each action is invoked either when you interact with AWS AppConfig or when AWS AppConfig is performing a process on your behalf. These invocation points are called action points. AWS AppConfig extensions support the following action points:
543+
544+
* PRE_START_DEPLOYMENT
545+
* PRE_CREATE_HOSTED_CONFIGURATION_VERSION
546+
* ON_DEPLOYMENT_START
547+
* ON_DEPLOYMENT_STEP
548+
* ON_DEPLOYMENT_BAKING
549+
* ON_DEPLOYMENT_COMPLETE
550+
* ON_DEPLOYMENT_ROLLED_BACK
551+
* AT_DEPLOYMENT_TICK
552+
553+
See: https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions-about.html
554+
542555
### AWS Lambda destination
543556

544557
Use an AWS Lambda as the event destination for an extension.

packages/aws-cdk-lib/aws-appconfig/lib/application.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ export interface IApplication extends cdk.IResource {
146146
*/
147147
onDeploymentRolledBack(eventDestination: IEventDestination, options?: ExtensionOptions): void;
148148

149+
/**
150+
* Adds an AT_DEPLOYMENT_TICK extension with the provided event destination and
151+
* also creates an extension association to an application.
152+
*
153+
* @param eventDestination The event that occurs during the extension
154+
* @param options Options for the extension
155+
*/
156+
atDeploymentTick(eventDestination: IEventDestination, options?: ExtensionOptions): void;
157+
149158
/**
150159
* Adds an extension association to the application.
151160
*
@@ -297,6 +306,17 @@ abstract class ApplicationBase extends cdk.Resource implements IApplication, IEx
297306
this.extensible.onDeploymentRolledBack(eventDestination, options);
298307
}
299308

309+
/**
310+
* Adds an AT_DEPLOYMENT_TICK extension with the provided event destination and
311+
* also creates an extension association to an application.
312+
*
313+
* @param eventDestination The event that occurs during the extension
314+
* @param options Options for the extension
315+
*/
316+
public atDeploymentTick(eventDestination: IEventDestination, options?: ExtensionOptions) {
317+
this.extensible.atDeploymentTick(eventDestination, options);
318+
}
319+
300320
/**
301321
* Adds an extension association to the application.
302322
*

0 commit comments

Comments
 (0)