Module codedeploy
This page documents the language specification for the aws package. If you're looking for help working with the inputs, outputs, or functions of aws resources in a Pulumi program, please see the resource documentation for examples and API reference.
This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the
pulumi/pulumi-awsrepo; however, if that doesn’t turn up anything, please consult the sourceterraform-providers/terraform-provider-awsrepo.
Resources
Others
- ApplicationArgs
- ApplicationState
- DeploymentConfigArgs
- DeploymentConfigState
- DeploymentGroupArgs
- DeploymentGroupState
Resources
Resource Application
class Application extends CustomResourceProvides a CodeDeploy application to be used as a basis for deployments
Example Usage
ECS Application
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.codedeploy.Application("example", {
computePlatform: "ECS",
});Lambda Application
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.codedeploy.Application("example", {
computePlatform: "Lambda",
});Server Application
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.codedeploy.Application("example", {
computePlatform: "Server",
});constructor
new Application(name: string, args?: ApplicationArgs, opts?: pulumi.CustomResourceOptions)Create a Application resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ApplicationState, opts?: pulumi.CustomResourceOptions): ApplicationGet an existing Application resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is ApplicationReturns true if the given object is an instance of Application. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property computePlatform
public computePlatform: pulumi.Output<string | undefined>;The compute platform can either be ECS, Lambda, or Server. Default is Server.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property name
public name: pulumi.Output<string>;The name of the application.
property uniqueId
public uniqueId: pulumi.Output<string>;property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Resource DeploymentConfig
class DeploymentConfig extends CustomResourceProvides a CodeDeploy deployment config for an application
Example Usage
Server Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const fooDeploymentConfig = new aws.codedeploy.DeploymentConfig("foo", {
deploymentConfigName: "test-deployment-config",
minimumHealthyHosts: {
type: "HOST_COUNT",
value: 2,
},
});
const fooDeploymentGroup = new aws.codedeploy.DeploymentGroup("foo", {
alarmConfiguration: {
alarms: ["my-alarm-name"],
enabled: true,
},
appName: aws_codedeploy_app_foo_app.name,
autoRollbackConfiguration: {
enabled: true,
events: ["DEPLOYMENT_FAILURE"],
},
deploymentConfigName: fooDeploymentConfig.id,
deploymentGroupName: "bar",
ec2TagFilters: [{
key: "filterkey",
type: "KEY_AND_VALUE",
value: "filtervalue",
}],
serviceRoleArn: aws_iam_role_foo_role.arn,
triggerConfigurations: [{
triggerEvents: ["DeploymentFailure"],
triggerName: "foo-trigger",
triggerTargetArn: "foo-topic-arn",
}],
});Lambda Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const fooDeploymentConfig = new aws.codedeploy.DeploymentConfig("foo", {
computePlatform: "Lambda",
deploymentConfigName: "test-deployment-config",
trafficRoutingConfig: {
timeBasedLinear: {
interval: 10,
percentage: 10,
},
type: "TimeBasedLinear",
},
});
const fooDeploymentGroup = new aws.codedeploy.DeploymentGroup("foo", {
alarmConfiguration: {
alarms: ["my-alarm-name"],
enabled: true,
},
appName: aws_codedeploy_app_foo_app.name,
autoRollbackConfiguration: {
enabled: true,
events: ["DEPLOYMENT_STOP_ON_ALARM"],
},
deploymentConfigName: fooDeploymentConfig.id,
deploymentGroupName: "bar",
serviceRoleArn: aws_iam_role_foo_role.arn,
});constructor
new DeploymentConfig(name: string, args: DeploymentConfigArgs, opts?: pulumi.CustomResourceOptions)Create a DeploymentConfig resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DeploymentConfigState, opts?: pulumi.CustomResourceOptions): DeploymentConfigGet an existing DeploymentConfig resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is DeploymentConfigReturns true if the given object is an instance of DeploymentConfig. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property computePlatform
public computePlatform: pulumi.Output<string | undefined>;The compute platform can be Server, Lambda, or ECS. Default is Server.
property deploymentConfigId
public deploymentConfigId: pulumi.Output<string>;The AWS Assigned deployment config id
property deploymentConfigName
public deploymentConfigName: pulumi.Output<string>;The name of the deployment config.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property minimumHealthyHosts
public minimumHealthyHosts: pulumi.Output<DeploymentConfigMinimumHealthyHosts | undefined>;A minimumHealthyHosts block. Required for Server compute platform. Minimum Healthy Hosts are documented below.
property trafficRoutingConfig
public trafficRoutingConfig: pulumi.Output<DeploymentConfigTrafficRoutingConfig | undefined>;A trafficRoutingConfig block. Traffic Routing Config is documented below.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Resource DeploymentGroup
class DeploymentGroup extends CustomResourceProvides a CodeDeploy Deployment Group for a CodeDeploy Application
NOTE on blue/green deployments: When using
greenFleetProvisioningOptionwith theCOPY_AUTO_SCALING_GROUPaction, CodeDeploy will create a new ASG with a different name. This ASG is not managed by this provider and will conflict with existing configuration and state. You may want to use a different approach to managing deployments that involve multiple ASG, such asDISCOVER_EXISTINGwith separate blue and green ASG.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const exampleRole = new aws.iam.Role("example", {
assumeRolePolicy: `{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": "codedeploy.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
`,
});
const aWSCodeDeployRole = new aws.iam.RolePolicyAttachment("AWSCodeDeployRole", {
policyArn: "arn:aws:iam::aws:policy/service-role/AWSCodeDeployRole",
role: exampleRole.name,
});
const exampleApplication = new aws.codedeploy.Application("example", {});
const exampleTopic = new aws.sns.Topic("example", {});
const exampleDeploymentGroup = new aws.codedeploy.DeploymentGroup("example", {
alarmConfiguration: {
alarms: ["my-alarm-name"],
enabled: true,
},
appName: exampleApplication.name,
autoRollbackConfiguration: {
enabled: true,
events: ["DEPLOYMENT_FAILURE"],
},
deploymentGroupName: "example-group",
ec2TagSets: [{
ec2TagFilters: [
{
key: "filterkey1",
type: "KEY_AND_VALUE",
value: "filtervalue",
},
{
key: "filterkey2",
type: "KEY_AND_VALUE",
value: "filtervalue",
},
],
}],
serviceRoleArn: exampleRole.arn,
triggerConfigurations: [{
triggerEvents: ["DeploymentFailure"],
triggerName: "example-trigger",
triggerTargetArn: exampleTopic.arn,
}],
});Blue Green Deployments with ECS
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const exampleApplication = new aws.codedeploy.Application("example", {
computePlatform: "ECS",
});
const exampleDeploymentGroup = new aws.codedeploy.DeploymentGroup("example", {
appName: exampleApplication.name,
autoRollbackConfiguration: {
enabled: true,
events: ["DEPLOYMENT_FAILURE"],
},
blueGreenDeploymentConfig: {
deploymentReadyOption: {
actionOnTimeout: "CONTINUE_DEPLOYMENT",
},
terminateBlueInstancesOnDeploymentSuccess: {
action: "TERMINATE",
terminationWaitTimeInMinutes: 5,
},
},
deploymentConfigName: "CodeDeployDefault.ECSAllAtOnce",
deploymentGroupName: "example",
deploymentStyle: {
deploymentOption: "WITH_TRAFFIC_CONTROL",
deploymentType: "BLUE_GREEN",
},
ecsService: {
clusterName: aws_ecs_cluster_example.name,
serviceName: aws_ecs_service_example.name,
},
loadBalancerInfo: {
targetGroupPairInfo: {
prodTrafficRoute: {
listenerArns: [aws_lb_listener_example.arn],
},
targetGroups: [
{
name: aws_lb_target_group_blue.name,
},
{
name: aws_lb_target_group_green.name,
},
],
},
},
serviceRoleArn: aws_iam_role_example.arn,
});Blue Green Deployments with Servers and Classic ELB
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const exampleApplication = new aws.codedeploy.Application("example", {});
const exampleDeploymentGroup = new aws.codedeploy.DeploymentGroup("example", {
appName: exampleApplication.name,
blueGreenDeploymentConfig: {
deploymentReadyOption: {
actionOnTimeout: "STOP_DEPLOYMENT",
waitTimeInMinutes: 60,
},
greenFleetProvisioningOption: {
action: "DISCOVER_EXISTING",
},
terminateBlueInstancesOnDeploymentSuccess: {
action: "KEEP_ALIVE",
},
},
deploymentGroupName: "example-group",
deploymentStyle: {
deploymentOption: "WITH_TRAFFIC_CONTROL",
deploymentType: "BLUE_GREEN",
},
loadBalancerInfo: {
elbInfos: [{
name: aws_elb_example.name,
}],
},
serviceRoleArn: aws_iam_role_example.arn,
});constructor
new DeploymentGroup(name: string, args: DeploymentGroupArgs, opts?: pulumi.CustomResourceOptions)Create a DeploymentGroup resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DeploymentGroupState, opts?: pulumi.CustomResourceOptions): DeploymentGroupGet an existing DeploymentGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is DeploymentGroupReturns true if the given object is an instance of DeploymentGroup. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property alarmConfiguration
public alarmConfiguration: pulumi.Output<DeploymentGroupAlarmConfiguration | undefined>;Configuration block of alarms associated with the deployment group (documented below).
property appName
public appName: pulumi.Output<string>;The name of the application.
property autoRollbackConfiguration
public autoRollbackConfiguration: pulumi.Output<DeploymentGroupAutoRollbackConfiguration | undefined>;Configuration block of the automatic rollback configuration associated with the deployment group (documented below).
property autoscalingGroups
public autoscalingGroups: pulumi.Output<string[] | undefined>;Autoscaling groups associated with the deployment group.
property blueGreenDeploymentConfig
public blueGreenDeploymentConfig: pulumi.Output<DeploymentGroupBlueGreenDeploymentConfig>;Configuration block of the blue/green deployment options for a deployment group (documented below).
property deploymentConfigName
public deploymentConfigName: pulumi.Output<string | undefined>;The name of the group’s deployment config. The default is “CodeDeployDefault.OneAtATime”.
property deploymentGroupName
public deploymentGroupName: pulumi.Output<string>;The name of the deployment group.
property deploymentStyle
public deploymentStyle: pulumi.Output<DeploymentGroupDeploymentStyle | undefined>;Configuration block of the type of deployment, either in-place or blue/green, you want to run and whether to route deployment traffic behind a load balancer (documented below).
property ec2TagFilters
public ec2TagFilters: pulumi.Output<DeploymentGroupEc2TagFilter[] | undefined>;Tag filters associated with the deployment group. See the AWS docs for details.
property ec2TagSets
public ec2TagSets: pulumi.Output<DeploymentGroupEc2TagSet[] | undefined>;Configuration block(s) of Tag filters associated with the deployment group, which are also referred to as tag groups (documented below). See the AWS docs for details.
property ecsService
public ecsService: pulumi.Output<DeploymentGroupEcsService | undefined>;Configuration block(s) of the ECS services for a deployment group (documented below).
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property loadBalancerInfo
public loadBalancerInfo: pulumi.Output<DeploymentGroupLoadBalancerInfo | undefined>;Single configuration block of the load balancer to use in a blue/green deployment (documented below).
property onPremisesInstanceTagFilters
public onPremisesInstanceTagFilters: pulumi.Output<DeploymentGroupOnPremisesInstanceTagFilter[] | undefined>;On premise tag filters associated with the group. See the AWS docs for details.
property serviceRoleArn
public serviceRoleArn: pulumi.Output<string>;The service role ARN that allows deployments.
property triggerConfigurations
public triggerConfigurations: pulumi.Output<DeploymentGroupTriggerConfiguration[] | undefined>;Configuration block(s) of the triggers for the deployment group (documented below).
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Others
interface ApplicationArgs
interface ApplicationArgsThe set of arguments for constructing a Application resource.
property computePlatform
computePlatform?: pulumi.Input<string>;The compute platform can either be ECS, Lambda, or Server. Default is Server.
property name
name?: pulumi.Input<string>;The name of the application.
property uniqueId
uniqueId?: pulumi.Input<string>;interface ApplicationState
interface ApplicationStateInput properties used for looking up and filtering Application resources.
property computePlatform
computePlatform?: pulumi.Input<string>;The compute platform can either be ECS, Lambda, or Server. Default is Server.
property name
name?: pulumi.Input<string>;The name of the application.
property uniqueId
uniqueId?: pulumi.Input<string>;interface DeploymentConfigArgs
interface DeploymentConfigArgsThe set of arguments for constructing a DeploymentConfig resource.
property computePlatform
computePlatform?: pulumi.Input<string>;The compute platform can be Server, Lambda, or ECS. Default is Server.
property deploymentConfigName
deploymentConfigName: pulumi.Input<string>;The name of the deployment config.
property minimumHealthyHosts
minimumHealthyHosts?: pulumi.Input<DeploymentConfigMinimumHealthyHosts>;A minimumHealthyHosts block. Required for Server compute platform. Minimum Healthy Hosts are documented below.
property trafficRoutingConfig
trafficRoutingConfig?: pulumi.Input<DeploymentConfigTrafficRoutingConfig>;A trafficRoutingConfig block. Traffic Routing Config is documented below.
interface DeploymentConfigState
interface DeploymentConfigStateInput properties used for looking up and filtering DeploymentConfig resources.
property computePlatform
computePlatform?: pulumi.Input<string>;The compute platform can be Server, Lambda, or ECS. Default is Server.
property deploymentConfigId
deploymentConfigId?: pulumi.Input<string>;The AWS Assigned deployment config id
property deploymentConfigName
deploymentConfigName?: pulumi.Input<string>;The name of the deployment config.
property minimumHealthyHosts
minimumHealthyHosts?: pulumi.Input<DeploymentConfigMinimumHealthyHosts>;A minimumHealthyHosts block. Required for Server compute platform. Minimum Healthy Hosts are documented below.
property trafficRoutingConfig
trafficRoutingConfig?: pulumi.Input<DeploymentConfigTrafficRoutingConfig>;A trafficRoutingConfig block. Traffic Routing Config is documented below.
interface DeploymentGroupArgs
interface DeploymentGroupArgsThe set of arguments for constructing a DeploymentGroup resource.
property alarmConfiguration
alarmConfiguration?: pulumi.Input<DeploymentGroupAlarmConfiguration>;Configuration block of alarms associated with the deployment group (documented below).
property appName
appName: pulumi.Input<string>;The name of the application.
property autoRollbackConfiguration
autoRollbackConfiguration?: pulumi.Input<DeploymentGroupAutoRollbackConfiguration>;Configuration block of the automatic rollback configuration associated with the deployment group (documented below).
property autoscalingGroups
autoscalingGroups?: pulumi.Input<pulumi.Input<string>[]>;Autoscaling groups associated with the deployment group.
property blueGreenDeploymentConfig
blueGreenDeploymentConfig?: pulumi.Input<DeploymentGroupBlueGreenDeploymentConfig>;Configuration block of the blue/green deployment options for a deployment group (documented below).
property deploymentConfigName
deploymentConfigName?: pulumi.Input<string>;The name of the group’s deployment config. The default is “CodeDeployDefault.OneAtATime”.
property deploymentGroupName
deploymentGroupName: pulumi.Input<string>;The name of the deployment group.
property deploymentStyle
deploymentStyle?: pulumi.Input<DeploymentGroupDeploymentStyle>;Configuration block of the type of deployment, either in-place or blue/green, you want to run and whether to route deployment traffic behind a load balancer (documented below).
property ec2TagFilters
ec2TagFilters?: pulumi.Input<pulumi.Input<DeploymentGroupEc2TagFilter>[]>;Tag filters associated with the deployment group. See the AWS docs for details.
property ec2TagSets
ec2TagSets?: pulumi.Input<pulumi.Input<DeploymentGroupEc2TagSet>[]>;Configuration block(s) of Tag filters associated with the deployment group, which are also referred to as tag groups (documented below). See the AWS docs for details.
property ecsService
ecsService?: pulumi.Input<DeploymentGroupEcsService>;Configuration block(s) of the ECS services for a deployment group (documented below).
property loadBalancerInfo
loadBalancerInfo?: pulumi.Input<DeploymentGroupLoadBalancerInfo>;Single configuration block of the load balancer to use in a blue/green deployment (documented below).
property onPremisesInstanceTagFilters
onPremisesInstanceTagFilters?: pulumi.Input<pulumi.Input<DeploymentGroupOnPremisesInstanceTagFilter>[]>;On premise tag filters associated with the group. See the AWS docs for details.
property serviceRoleArn
serviceRoleArn: pulumi.Input<string>;The service role ARN that allows deployments.
property triggerConfigurations
triggerConfigurations?: pulumi.Input<pulumi.Input<DeploymentGroupTriggerConfiguration>[]>;Configuration block(s) of the triggers for the deployment group (documented below).
interface DeploymentGroupState
interface DeploymentGroupStateInput properties used for looking up and filtering DeploymentGroup resources.
property alarmConfiguration
alarmConfiguration?: pulumi.Input<DeploymentGroupAlarmConfiguration>;Configuration block of alarms associated with the deployment group (documented below).
property appName
appName?: pulumi.Input<string>;The name of the application.
property autoRollbackConfiguration
autoRollbackConfiguration?: pulumi.Input<DeploymentGroupAutoRollbackConfiguration>;Configuration block of the automatic rollback configuration associated with the deployment group (documented below).
property autoscalingGroups
autoscalingGroups?: pulumi.Input<pulumi.Input<string>[]>;Autoscaling groups associated with the deployment group.
property blueGreenDeploymentConfig
blueGreenDeploymentConfig?: pulumi.Input<DeploymentGroupBlueGreenDeploymentConfig>;Configuration block of the blue/green deployment options for a deployment group (documented below).
property deploymentConfigName
deploymentConfigName?: pulumi.Input<string>;The name of the group’s deployment config. The default is “CodeDeployDefault.OneAtATime”.
property deploymentGroupName
deploymentGroupName?: pulumi.Input<string>;The name of the deployment group.
property deploymentStyle
deploymentStyle?: pulumi.Input<DeploymentGroupDeploymentStyle>;Configuration block of the type of deployment, either in-place or blue/green, you want to run and whether to route deployment traffic behind a load balancer (documented below).
property ec2TagFilters
ec2TagFilters?: pulumi.Input<pulumi.Input<DeploymentGroupEc2TagFilter>[]>;Tag filters associated with the deployment group. See the AWS docs for details.
property ec2TagSets
ec2TagSets?: pulumi.Input<pulumi.Input<DeploymentGroupEc2TagSet>[]>;Configuration block(s) of Tag filters associated with the deployment group, which are also referred to as tag groups (documented below). See the AWS docs for details.
property ecsService
ecsService?: pulumi.Input<DeploymentGroupEcsService>;Configuration block(s) of the ECS services for a deployment group (documented below).
property loadBalancerInfo
loadBalancerInfo?: pulumi.Input<DeploymentGroupLoadBalancerInfo>;Single configuration block of the load balancer to use in a blue/green deployment (documented below).
property onPremisesInstanceTagFilters
onPremisesInstanceTagFilters?: pulumi.Input<pulumi.Input<DeploymentGroupOnPremisesInstanceTagFilter>[]>;On premise tag filters associated with the group. See the AWS docs for details.
property serviceRoleArn
serviceRoleArn?: pulumi.Input<string>;The service role ARN that allows deployments.
property triggerConfigurations
triggerConfigurations?: pulumi.Input<pulumi.Input<DeploymentGroupTriggerConfiguration>[]>;Configuration block(s) of the triggers for the deployment group (documented below).