Skip to content

Commit

Permalink
feat(appconfig): add atDeploymentTick extension action point to L2 Co…
Browse files Browse the repository at this point in the history
…nstructs
  • Loading branch information
cpaluch-aws committed Dec 5, 2024
1 parent b30c823 commit a9de9d4
Show file tree
Hide file tree
Showing 15 changed files with 179 additions and 36 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,23 @@
]
}
}
],
"AT_DEPLOYMENT_TICK": [
{
"Name": "awsappconfigextension-MyLambdaExtension-68C15290-0",
"Uri": {
"Fn::GetAtt": [
"MyFunction3BAA72D1",
"Arn"
]
},
"RoleArn": {
"Fn::GetAtt": [
"MyLambdaExtensionRoleBC958D3F13B04",
"Arn"
]
}
}
]
},
"Name": "awsappconfigextension-MyLambdaExtension-68C15290"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const lambdaExtension = new Extension(stack, 'MyLambdaExtension', {
actionPoints: [
ActionPoint.PRE_CREATE_HOSTED_CONFIGURATION_VERSION,
ActionPoint.ON_DEPLOYMENT_START,
ActionPoint.AT_DEPLOYMENT_TICK,
],
eventDestination: new LambdaDestination(lambda),
}),
Expand Down
20 changes: 20 additions & 0 deletions packages/aws-cdk-lib/aws-appconfig/lib/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ export interface IApplication extends cdk.IResource {
*/
onDeploymentRolledBack(eventDestination: IEventDestination, options?: ExtensionOptions): void;

/**
* Adds an AT_DEPLOYMENT_TICK extension with the provided event destination and
* also creates an extension association to an application.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
atDeploymentTick(eventDestination: IEventDestination, options?: ExtensionOptions): void;

/**
* Adds an extension association to the application.
*
Expand Down Expand Up @@ -297,6 +306,17 @@ abstract class ApplicationBase extends cdk.Resource implements IApplication, IEx
this.extensible.onDeploymentRolledBack(eventDestination, options);
}

/**
* Adds an AT_DEPLOYMENT_TICK extension with the provided event destination and
* also creates an extension association to an application.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
public atDeploymentTick(eventDestination: IEventDestination, options?: ExtensionOptions) {
this.extensible.atDeploymentTick(eventDestination, options);
}

/**
* Adds an extension association to the application.
*
Expand Down
11 changes: 11 additions & 0 deletions packages/aws-cdk-lib/aws-appconfig/lib/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,17 @@ abstract class ConfigurationBase extends Construct implements IConfiguration, IE
this.extensible.onDeploymentRolledBack(eventDestination, options);
}

/**
* Adds an AT_DEPLOYMENT_TICK extension with the provided event destination and
* also creates an extension association to an application.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
public atDeploymentTick(eventDestination: IEventDestination, options?: ExtensionOptions) {
this.extensible.atDeploymentTick(eventDestination, options);
}

/**
* Adds an extension association to the configuration profile.
*
Expand Down
13 changes: 13 additions & 0 deletions packages/aws-cdk-lib/aws-appconfig/lib/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ abstract class EnvironmentBase extends Resource implements IEnvironment, IExtens
this.extensible.onDeploymentRolledBack(eventDestination, options);
}

public atDeploymentTick(eventDestination: IEventDestination, options?: ExtensionOptions) {
this.extensible.atDeploymentTick(eventDestination, options);
}

public addExtension(extension: IExtension) {
this.extensible.addExtension(extension);
}
Expand Down Expand Up @@ -556,6 +560,15 @@ export interface IEnvironment extends IResource {
*/
onDeploymentRolledBack(eventDestination: IEventDestination, options?: ExtensionOptions): void;

/**
* Adds an AT_DEPLOYMENT_TICK extension with the provided event destination and
* also creates an extension association to an application.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
atDeploymentTick(eventDestination: IEventDestination, options?: ExtensionOptions): void;

/**
* Adds an extension association to the environment.
*
Expand Down
14 changes: 14 additions & 0 deletions packages/aws-cdk-lib/aws-appconfig/lib/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export enum ActionPoint {
ON_DEPLOYMENT_BAKING = 'ON_DEPLOYMENT_BAKING',
ON_DEPLOYMENT_COMPLETE = 'ON_DEPLOYMENT_COMPLETE',
ON_DEPLOYMENT_ROLLED_BACK = 'ON_DEPLOYMENT_ROLLED_BACK',
AT_DEPLOYMENT_TICK = 'AT_DEPLOYMENT_TICK',
}

/**
Expand Down Expand Up @@ -657,6 +658,10 @@ export class ExtensibleBase implements IExtensible {
this.getExtensionForActionPoint(eventDestination, ActionPoint.ON_DEPLOYMENT_ROLLED_BACK, options);
}

public atDeploymentTick(eventDestination: IEventDestination, options?: ExtensionOptions) {
this.getExtensionForActionPoint(eventDestination, ActionPoint.AT_DEPLOYMENT_TICK, options);
}

public addExtension(extension: IExtension) {
this.addExtensionAssociation(extension);
}
Expand Down Expand Up @@ -793,6 +798,15 @@ export interface IExtensible {
*/
onDeploymentRolledBack(eventDestination: IEventDestination, options?: ExtensionOptions): void;

/**
* Adds an AT_DEPLOYMENT_TICK extension with the provided event destination and
* also creates an extension association to the derived resource.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
atDeploymentTick(eventDestination: IEventDestination, options?: ExtensionOptions): void;

/**
* Adds an extension association to the derived resource.
*
Expand Down
Loading

0 comments on commit a9de9d4

Please sign in to comment.