Skip to content
v2.273.0

CfnCodeDeployBlueGreenHookProps Struct ​

Construction properties of CfnCodeDeployBlueGreenHook.

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 ​

Additional options for the blue/green deployment.
Properties of the Amazon ECS applications being deployed.
Use lifecycle event hooks to specify a Lambda function that CodeDeploy can call to validate a deployment.
notes

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'.

serviceRolestringservice_rolestrserviceRoleStringServiceRolestringServiceRole*stringrequired#
The IAM Role for CloudFormation to use to perform blue-green deployments.
trafficRoutingConfigCfnTrafficRoutingConfigtraffic_routing_configCfnTrafficRoutingConfigtrafficRoutingConfigCfnTrafficRoutingConfigTrafficRoutingConfigCfnTrafficRoutingConfigTrafficRoutingConfigCfnTrafficRoutingConfig= time-based canary traffic shifti…#
Traffic routing configuration settings.
default

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

Used as props by ​