Resource: awsCodedeployDeploymentConfig
Provides a CodeDeploy deployment config for an application
Example Usage
Server Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsCodedeployDeploymentConfigFoo =
new aws.codedeployDeploymentConfig.CodedeployDeploymentConfig(this, "foo", {
deploymentConfigName: "test-deployment-config",
minimumHealthyHosts: {
type: "HOST_COUNT",
value: 2,
},
});
const awsCodedeployDeploymentGroupFoo =
new aws.codedeployDeploymentGroup.CodedeployDeploymentGroup(this, "foo_1", {
alarmConfiguration: {
alarms: ["my-alarm-name"],
enabled: true,
},
appName: "${aws_codedeploy_app.foo_app.name}",
autoRollbackConfiguration: {
enabled: true,
events: ["DEPLOYMENT_FAILURE"],
},
deploymentConfigName: awsCodedeployDeploymentConfigFoo.id,
deploymentGroupName: "bar",
ec2TagFilter: [
{
key: "filterkey",
type: "KEY_AND_VALUE",
value: "filtervalue",
},
],
serviceRoleArn: "${aws_iam_role.foo_role.arn}",
triggerConfiguration: [
{
triggerEvents: ["DeploymentFailure"],
triggerName: "foo-trigger",
triggerTargetArn: "foo-topic-arn",
},
],
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsCodedeployDeploymentGroupFoo.overrideLogicalId("foo");
Lambda Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsCodedeployDeploymentConfigFoo =
new aws.codedeployDeploymentConfig.CodedeployDeploymentConfig(this, "foo", {
computePlatform: "Lambda",
deploymentConfigName: "test-deployment-config",
trafficRoutingConfig: {
timeBasedLinear: {
interval: 10,
percentage: 10,
},
type: "TimeBasedLinear",
},
});
const awsCodedeployDeploymentGroupFoo =
new aws.codedeployDeploymentGroup.CodedeployDeploymentGroup(this, "foo_1", {
alarmConfiguration: {
alarms: ["my-alarm-name"],
enabled: true,
},
appName: "${aws_codedeploy_app.foo_app.name}",
autoRollbackConfiguration: {
enabled: true,
events: ["DEPLOYMENT_STOP_ON_ALARM"],
},
deploymentConfigName: awsCodedeployDeploymentConfigFoo.id,
deploymentGroupName: "bar",
serviceRoleArn: "${aws_iam_role.foo_role.arn}",
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsCodedeployDeploymentGroupFoo.overrideLogicalId("foo");
Argument Reference
The following arguments are supported:
deploymentConfigName
- (Required) The name of the deployment config.computePlatform
- (Optional) The compute platform can beserver
,lambda
, orecs
. Default isserver
.minimumHealthyHosts
- (Optional) A minimum_healthy_hosts block. Required forserver
compute platform. Minimum Healthy Hosts are documented below.trafficRoutingConfig
- (Optional) A traffic_routing_config block. Traffic Routing Config is documented below.
The minimumHealthyHosts
block supports the following:
type
- (Required) The type can either beFLEET_PERCENT
orHOST_COUNT
.value
- (Required) The value when the type isFLEET_PERCENT
represents the minimum number of healthy instances as a percentage of the total number of instances in the deployment. If you specify FLEET_PERCENT, at the start of the deployment, AWS CodeDeploy converts the percentage to the equivalent number of instance and rounds up fractional instances. When the type isHOST_COUNT
, the value represents the minimum number of healthy instances as an absolute value.
The trafficRoutingConfig
block supports the following:
type
- (Optional) Type of traffic routing config. One oftimeBasedCanary
,timeBasedLinear
,allAtOnce
.timeBasedCanary
- (Optional) The time based canary configuration information. Iftype
istimeBasedLinear
, usetimeBasedLinear
instead.timeBasedLinear
- (Optional) The time based linear configuration information. Iftype
istimeBasedCanary
, usetimeBasedCanary
instead.
The timeBasedCanary
block supports the following:
interval
- (Optional) The number of minutes between the first and second traffic shifts of atimeBasedCanary
deployment.percentage
- (Optional) The percentage of traffic to shift in the first increment of atimeBasedCanary
deployment.
The timeBasedLinear
block supports the following:
interval
- (Optional) The number of minutes between each incremental traffic shift of atimeBasedLinear
deployment.percentage
- (Optional) The percentage of traffic that is shifted at the start of each increment of atimeBasedLinear
deployment.
Attributes Reference
In addition to all arguments above, the following attributes are exported:
id
- The deployment group's config name.deploymentConfigId
- The AWS Assigned deployment config id
Import
CodeDeploy Deployment Configurations can be imported using the deploymentConfigName
, e.g.,