# CfnCodeDeployBlueGreenHookProps

Construction properties of `CfnCodeDeployBlueGreenHook`.

Extends: CfnCodeDeployBlueGreenHookProps
Used as props by: CfnCodeDeployBlueGreenHook

- Source: [`core/lib/cfn-codedeploy-blue-green-hook.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/core/lib/cfn-codedeploy-blue-green-hook.ts#L251)

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const cfnCodeDeployBlueGreenHookProps: cdk.CfnCodeDeployBlueGreenHookProps = {
  applications: [{
    ecsAttributes: {
      taskDefinitions: ['taskDefinitions'],
      taskSets: ['taskSets'],
      trafficRouting: {
        prodTrafficRoute: {
          logicalId: 'logicalId',
          type: 'type',
        },
        targetGroups: ['targetGroups'],
        testTrafficRoute: {
          logicalId: 'logicalId',
          type: 'type',
        },
      },
    },
    target: {
      logicalId: 'logicalId',
      type: 'type',
    },
  }],
  serviceRole: 'serviceRole',

  // the properties below are optional
  additionalOptions: {
    terminationWaitTimeInMinutes: 123,
  },
  lifecycleEventHooks: {
    afterAllowTestTraffic: 'afterAllowTestTraffic',
    afterAllowTraffic: 'afterAllowTraffic',
    afterInstall: 'afterInstall',
    beforeAllowTraffic: 'beforeAllowTraffic',
    beforeInstall: 'beforeInstall',
  },
  trafficRoutingConfig: {
    type: cdk.CfnTrafficRoutingType.ALL_AT_ONCE,

    // the properties below are optional
    timeBasedCanary: {
      bakeTimeMins: 123,
      stepPercentage: 123,
    },
    timeBasedLinear: {
      bakeTimeMins: 123,
      stepPercentage: 123,
    },
  },
};
```

## Properties

- `additionalOptions`: [CfnCodeDeployBlueGreenAdditionalOptions](/cdk/api/v2/docs/aws-cdk-lib.CfnCodeDeployBlueGreenAdditionalOptions.html) — Additional options for the blue/green deployment.

  **Default:** no additional options

- `applications`: [CfnCodeDeployBlueGreenApplication](/cdk/api/v2/docs/aws-cdk-lib.CfnCodeDeployBlueGreenApplication.html)[] (required) — Properties of the Amazon ECS applications being deployed.

- `lifecycleEventHooks`: [CfnCodeDeployBlueGreenLifecycleEventHooks](/cdk/api/v2/docs/aws-cdk-lib.CfnCodeDeployBlueGreenLifecycleEventHooks.html) — Use lifecycle event hooks to specify a Lambda function that CodeDeploy can call to validate a deployment.

  **Default:** no lifecycle event hooks

  You can use the same function or a different one for deployment lifecycle events.
  Following completion of the validation tests,
  the Lambda `CfnCodeDeployBlueGreenLifecycleEventHooks.afterAllowTraffic`
  function calls back CodeDeploy and delivers a result of 'Succeeded' or 'Failed'.

- `serviceRole`: string (required) — The IAM Role for CloudFormation to use to perform blue-green deployments.

- `trafficRoutingConfig`: [CfnTrafficRoutingConfig](/cdk/api/v2/docs/aws-cdk-lib.CfnTrafficRoutingConfig.html) — Traffic routing configuration settings.

  **Default:** time-based canary traffic shifting, with a 15% step percentage and a five minute bake time
