# DeploymentLifecycleHookTargetConfig

Configuration for a deployment lifecycle hook target.

Returned by: [IDeploymentLifecycleHookTarget.bind](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.IDeploymentLifecycleHookTarget.html#bind)

- Source: [`aws-ecs/lib/deployment-lifecycle-hook-target.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-ecs/lib/deployment-lifecycle-hook-target.ts#L42)
- Type last changed: v2.211.0 · 13 Aug 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs as ecs } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';

declare const role: iam.Role;
const deploymentLifecycleHookTargetConfig: ecs.DeploymentLifecycleHookTargetConfig = {
  lifecycleStages: [ecs.DeploymentLifecycleStage.RECONCILE_SERVICE],
  targetArn: 'targetArn',

  // the properties below are optional
  role: role,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ecs as ecs
from aws_cdk import aws_iam as iam

# role: iam.Role

deployment_lifecycle_hook_target_config = ecs.DeploymentLifecycleHookTargetConfig(
    lifecycle_stages=[ecs.DeploymentLifecycleStage.RECONCILE_SERVICE],
    target_arn="targetArn",

    # the properties below are optional
    role=role
)
```

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.services.ecs.*;
import software.amazon.awscdk.services.iam.*;

Role role;

DeploymentLifecycleHookTargetConfig deploymentLifecycleHookTargetConfig = DeploymentLifecycleHookTargetConfig.builder()
        .lifecycleStages(List.of(DeploymentLifecycleStage.RECONCILE_SERVICE))
        .targetArn("targetArn")

        // the properties below are optional
        .role(role)
        .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.AWS.ECS;
using Amazon.CDK.AWS.IAM;

Role role;

var deploymentLifecycleHookTargetConfig = new DeploymentLifecycleHookTargetConfig {
    LifecycleStages = new [] { DeploymentLifecycleStage.RECONCILE_SERVICE },
    TargetArn = "targetArn",

    // the properties below are optional
    Role = role
};
```

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"
import "github.com/aws/aws-cdk-go/awscdk"

var role Role

deploymentLifecycleHookTargetConfig := &DeploymentLifecycleHookTargetConfig{
	LifecycleStages: []DeploymentLifecycleStage{
		awscdk.Aws_ecs.DeploymentLifecycleStage_RECONCILE_SERVICE,
	},
	TargetArn: jsii.String("targetArn"),

	// the properties below are optional
	Role: role,
}
```

## Properties

- `lifecycleStages`: [DeploymentLifecycleStage](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.DeploymentLifecycleStage.html)[] (required) — The lifecycle stages when this hook should be executed.

- `role`: [IRole](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — The IAM role that grants permissions to invoke the target.

  **Default:** a role will be created automatically

- `targetArn`: string (required) — The ARN of the target resource.
