# Hooks

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

- Source: [`lib/integ-tests/test-case.ts`](https://github.com/aws/aws-cdk-cli/blob/HEAD/packages/@aws-cdk/cloud-assembly-schema/lib/integ-tests/test-case.ts)
- Type last changed: v2.20.0 · 7 Apr 2022

## Example

TypeScript:

```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:

```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:

```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();
```

C# / .NET:

```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" }
};
```

Golang:

```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

- `postDeploy`: string[] — Commands to run prior after deploying the cdk stacks in the integration test.

  **Default:** no commands

- `postDestroy`: string[] — Commands to run after destroying the cdk stacks in the integration test.

  **Default:** no commands

- `preDeploy`: string[] — Commands to run prior to deploying the cdk stacks in the integration test.

  **Default:** no commands

- `preDestroy`: string[] — Commands to run prior to destroying the cdk stacks in the integration test.

  **Default:** no commands
