Skip to content
v2.278.0

Hooks Struct ​

Commands to run at predefined points during the integration test workflow.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { cloud_assembly_schema } from 'aws-cdk-lib';
const hooks: cloud_assembly_schema.Hooks = {
  postDeploy: ['postDeploy'],
  postDestroy: ['postDestroy'],
  preDeploy: ['preDeploy'],
  preDestroy: ['preDestroy'],
};
python
from aws_cdk.cloud_assembly_schema import Hooks
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import cloud_assembly_schema

hooks = Hooks(
    post_deploy=["postDeploy"],
    post_destroy=["postDestroy"],
    pre_deploy=["preDeploy"],
    pre_destroy=["preDestroy"]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.cloud_assembly_schema.*;

Hooks hooks = Hooks.builder()
        .postDeploy(List.of("postDeploy"))
        .postDestroy(List.of("postDestroy"))
        .preDeploy(List.of("preDeploy"))
        .preDestroy(List.of("preDestroy"))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.Cloud_assembly_schema;

var hooks = new Hooks {
    PostDeploy = new [] { "postDeploy" },
    PostDestroy = new [] { "postDestroy" },
    PreDeploy = new [] { "preDeploy" },
    PreDestroy = new [] { "preDestroy" }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

hooks := &Hooks{
	PostDeploy: []*string{
		jsii.String("postDeploy"),
	},
	PostDestroy: []*string{
		jsii.String("postDestroy"),
	},
	PreDeploy: []*string{
		jsii.String("preDeploy"),
	},
	PreDestroy: []*string{
		jsii.String("preDestroy"),
	},
}

Properties ​

postDeployoptionalstring[]post_deployoptionaltyping.List[str]postDeployoptionalList<String>PostDeployoptionalstring[]PostDeployoptional*[]*string #
Commands to run prior after deploying the cdk stacks in the integration test.

Default: no commands

postDestroyoptionalstring[]post_destroyoptionaltyping.List[str]postDestroyoptionalList<String>PostDestroyoptionalstring[]PostDestroyoptional*[]*string #
Commands to run after destroying the cdk stacks in the integration test.

Default: no commands

preDeployoptionalstring[]pre_deployoptionaltyping.List[str]preDeployoptionalList<String>PreDeployoptionalstring[]PreDeployoptional*[]*string #
Commands to run prior to deploying the cdk stacks in the integration test.

Default: no commands

preDestroyoptionalstring[]pre_destroyoptionaltyping.List[str]preDestroyoptionalList<String>PreDestroyoptionalstring[]PreDestroyoptional*[]*string #
Commands to run prior to destroying the cdk stacks in the integration test.

Default: no commands