DeploymentConfig
Provides a CodeDeploy deployment config for an application
Example Usage
Server Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var fooDeploymentConfig = new Aws.CodeDeploy.DeploymentConfig("fooDeploymentConfig", new Aws.CodeDeploy.DeploymentConfigArgs
{
DeploymentConfigName = "test-deployment-config",
MinimumHealthyHosts = new Aws.CodeDeploy.Inputs.DeploymentConfigMinimumHealthyHostsArgs
{
Type = "HOST_COUNT",
Value = 2,
},
});
var fooDeploymentGroup = new Aws.CodeDeploy.DeploymentGroup("fooDeploymentGroup", new Aws.CodeDeploy.DeploymentGroupArgs
{
AlarmConfiguration = new Aws.CodeDeploy.Inputs.DeploymentGroupAlarmConfigurationArgs
{
Alarms =
{
"my-alarm-name",
},
Enabled = true,
},
AppName = aws_codedeploy_app.Foo_app.Name,
AutoRollbackConfiguration = new Aws.CodeDeploy.Inputs.DeploymentGroupAutoRollbackConfigurationArgs
{
Enabled = true,
Events =
{
"DEPLOYMENT_FAILURE",
},
},
DeploymentConfigName = fooDeploymentConfig.Id,
DeploymentGroupName = "bar",
Ec2TagFilters =
{
new Aws.CodeDeploy.Inputs.DeploymentGroupEc2TagFilterArgs
{
Key = "filterkey",
Type = "KEY_AND_VALUE",
Value = "filtervalue",
},
},
ServiceRoleArn = aws_iam_role.Foo_role.Arn,
TriggerConfigurations =
{
new Aws.CodeDeploy.Inputs.DeploymentGroupTriggerConfigurationArgs
{
TriggerEvents =
{
"DeploymentFailure",
},
TriggerName = "foo-trigger",
TriggerTargetArn = "foo-topic-arn",
},
},
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/codedeploy"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
fooDeploymentConfig, err := codedeploy.NewDeploymentConfig(ctx, "fooDeploymentConfig", &codedeploy.DeploymentConfigArgs{
DeploymentConfigName: pulumi.String("test-deployment-config"),
MinimumHealthyHosts: &codedeploy.DeploymentConfigMinimumHealthyHostsArgs{
Type: pulumi.String("HOST_COUNT"),
Value: pulumi.Int(2),
},
})
if err != nil {
return err
}
_, err = codedeploy.NewDeploymentGroup(ctx, "fooDeploymentGroup", &codedeploy.DeploymentGroupArgs{
AlarmConfiguration: &codedeploy.DeploymentGroupAlarmConfigurationArgs{
Alarms: pulumi.StringArray{
pulumi.String("my-alarm-name"),
},
Enabled: pulumi.Bool(true),
},
AppName: pulumi.String(aws_codedeploy_app.Foo_app.Name),
AutoRollbackConfiguration: &codedeploy.DeploymentGroupAutoRollbackConfigurationArgs{
Enabled: pulumi.Bool(true),
Events: pulumi.StringArray{
pulumi.String("DEPLOYMENT_FAILURE"),
},
},
DeploymentConfigName: fooDeploymentConfig.ID(),
DeploymentGroupName: pulumi.String("bar"),
Ec2TagFilters: codedeploy.DeploymentGroupEc2TagFilterArray{
&codedeploy.DeploymentGroupEc2TagFilterArgs{
Key: pulumi.String("filterkey"),
Type: pulumi.String("KEY_AND_VALUE"),
Value: pulumi.String("filtervalue"),
},
},
ServiceRoleArn: pulumi.String(aws_iam_role.Foo_role.Arn),
TriggerConfigurations: codedeploy.DeploymentGroupTriggerConfigurationArray{
&codedeploy.DeploymentGroupTriggerConfigurationArgs{
TriggerEvents: pulumi.StringArray{
pulumi.String("DeploymentFailure"),
},
TriggerName: pulumi.String("foo-trigger"),
TriggerTargetArn: pulumi.String("foo-topic-arn"),
},
},
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
foo_deployment_config = aws.codedeploy.DeploymentConfig("fooDeploymentConfig",
deployment_config_name="test-deployment-config",
minimum_healthy_hosts={
"type": "HOST_COUNT",
"value": 2,
})
foo_deployment_group = aws.codedeploy.DeploymentGroup("fooDeploymentGroup",
alarm_configuration={
"alarms": ["my-alarm-name"],
"enabled": True,
},
app_name=aws_codedeploy_app["foo_app"]["name"],
auto_rollback_configuration={
"enabled": True,
"events": ["DEPLOYMENT_FAILURE"],
},
deployment_config_name=foo_deployment_config.id,
deployment_group_name="bar",
ec2_tag_filters=[{
"key": "filterkey",
"type": "KEY_AND_VALUE",
"value": "filtervalue",
}],
service_role_arn=aws_iam_role["foo_role"]["arn"],
trigger_configurations=[{
"triggerEvents": ["DeploymentFailure"],
"triggerName": "foo-trigger",
"triggerTargetArn": "foo-topic-arn",
}])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
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var fooDeploymentConfig = new Aws.CodeDeploy.DeploymentConfig("fooDeploymentConfig", new Aws.CodeDeploy.DeploymentConfigArgs
{
ComputePlatform = "Lambda",
DeploymentConfigName = "test-deployment-config",
TrafficRoutingConfig = new Aws.CodeDeploy.Inputs.DeploymentConfigTrafficRoutingConfigArgs
{
TimeBasedLinear = new Aws.CodeDeploy.Inputs.DeploymentConfigTrafficRoutingConfigTimeBasedLinearArgs
{
Interval = 10,
Percentage = 10,
},
Type = "TimeBasedLinear",
},
});
var fooDeploymentGroup = new Aws.CodeDeploy.DeploymentGroup("fooDeploymentGroup", new Aws.CodeDeploy.DeploymentGroupArgs
{
AlarmConfiguration = new Aws.CodeDeploy.Inputs.DeploymentGroupAlarmConfigurationArgs
{
Alarms =
{
"my-alarm-name",
},
Enabled = true,
},
AppName = aws_codedeploy_app.Foo_app.Name,
AutoRollbackConfiguration = new Aws.CodeDeploy.Inputs.DeploymentGroupAutoRollbackConfigurationArgs
{
Enabled = true,
Events =
{
"DEPLOYMENT_STOP_ON_ALARM",
},
},
DeploymentConfigName = fooDeploymentConfig.Id,
DeploymentGroupName = "bar",
ServiceRoleArn = aws_iam_role.Foo_role.Arn,
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/codedeploy"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
fooDeploymentConfig, err := codedeploy.NewDeploymentConfig(ctx, "fooDeploymentConfig", &codedeploy.DeploymentConfigArgs{
ComputePlatform: pulumi.String("Lambda"),
DeploymentConfigName: pulumi.String("test-deployment-config"),
TrafficRoutingConfig: &codedeploy.DeploymentConfigTrafficRoutingConfigArgs{
TimeBasedLinear: &codedeploy.DeploymentConfigTrafficRoutingConfigTimeBasedLinearArgs{
Interval: pulumi.Int(10),
Percentage: pulumi.Int(10),
},
Type: pulumi.String("TimeBasedLinear"),
},
})
if err != nil {
return err
}
_, err = codedeploy.NewDeploymentGroup(ctx, "fooDeploymentGroup", &codedeploy.DeploymentGroupArgs{
AlarmConfiguration: &codedeploy.DeploymentGroupAlarmConfigurationArgs{
Alarms: pulumi.StringArray{
pulumi.String("my-alarm-name"),
},
Enabled: pulumi.Bool(true),
},
AppName: pulumi.String(aws_codedeploy_app.Foo_app.Name),
AutoRollbackConfiguration: &codedeploy.DeploymentGroupAutoRollbackConfigurationArgs{
Enabled: pulumi.Bool(true),
Events: pulumi.StringArray{
pulumi.String("DEPLOYMENT_STOP_ON_ALARM"),
},
},
DeploymentConfigName: fooDeploymentConfig.ID(),
DeploymentGroupName: pulumi.String("bar"),
ServiceRoleArn: pulumi.String(aws_iam_role.Foo_role.Arn),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
foo_deployment_config = aws.codedeploy.DeploymentConfig("fooDeploymentConfig",
compute_platform="Lambda",
deployment_config_name="test-deployment-config",
traffic_routing_config={
"timeBasedLinear": {
"interval": 10,
"percentage": 10,
},
"type": "TimeBasedLinear",
})
foo_deployment_group = aws.codedeploy.DeploymentGroup("fooDeploymentGroup",
alarm_configuration={
"alarms": ["my-alarm-name"],
"enabled": True,
},
app_name=aws_codedeploy_app["foo_app"]["name"],
auto_rollback_configuration={
"enabled": True,
"events": ["DEPLOYMENT_STOP_ON_ALARM"],
},
deployment_config_name=foo_deployment_config.id,
deployment_group_name="bar",
service_role_arn=aws_iam_role["foo_role"]["arn"])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,
});Create a DeploymentConfig Resource
new DeploymentConfig(name: string, args: DeploymentConfigArgs, opts?: CustomResourceOptions);def DeploymentConfig(resource_name, opts=None, compute_platform=None, deployment_config_name=None, minimum_healthy_hosts=None, traffic_routing_config=None, __props__=None);func NewDeploymentConfig(ctx *Context, name string, args DeploymentConfigArgs, opts ...ResourceOption) (*DeploymentConfig, error)public DeploymentConfig(string name, DeploymentConfigArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args DeploymentConfigArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DeploymentConfigArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DeploymentConfigArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
DeploymentConfig Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The DeploymentConfig resource accepts the following input properties:
- Deployment
Config stringName The name of the deployment config.
- Compute
Platform string The compute platform can be
Server,Lambda, orECS. Default isServer.- Minimum
Healthy DeploymentHosts Config Minimum Healthy Hosts Args A minimum_healthy_hosts block. Required for
Servercompute platform. Minimum Healthy Hosts are documented below.- Traffic
Routing DeploymentConfig Config Traffic Routing Config Args A traffic_routing_config block. Traffic Routing Config is documented below.
- Deployment
Config stringName The name of the deployment config.
- Compute
Platform string The compute platform can be
Server,Lambda, orECS. Default isServer.- Minimum
Healthy DeploymentHosts Config Minimum Healthy Hosts A minimum_healthy_hosts block. Required for
Servercompute platform. Minimum Healthy Hosts are documented below.- Traffic
Routing DeploymentConfig Config Traffic Routing Config A traffic_routing_config block. Traffic Routing Config is documented below.
- deployment
Config stringName The name of the deployment config.
- compute
Platform string The compute platform can be
Server,Lambda, orECS. Default isServer.- minimum
Healthy DeploymentHosts Config Minimum Healthy Hosts A minimum_healthy_hosts block. Required for
Servercompute platform. Minimum Healthy Hosts are documented below.- traffic
Routing DeploymentConfig Config Traffic Routing Config A traffic_routing_config block. Traffic Routing Config is documented below.
- deployment_
config_ strname The name of the deployment config.
- compute_
platform str The compute platform can be
Server,Lambda, orECS. Default isServer.- minimum_
healthy_ Dict[Deploymenthosts Config Minimum Healthy Hosts] A minimum_healthy_hosts block. Required for
Servercompute platform. Minimum Healthy Hosts are documented below.- traffic_
routing_ Dict[Deploymentconfig Config Traffic Routing Config] A traffic_routing_config block. Traffic Routing Config is documented below.
Outputs
All input properties are implicitly available as output properties. Additionally, the DeploymentConfig resource produces the following output properties:
- Deployment
Config stringId The AWS Assigned deployment config id
- Id string
- The provider-assigned unique ID for this managed resource.
- Deployment
Config stringId The AWS Assigned deployment config id
- Id string
- The provider-assigned unique ID for this managed resource.
- deployment
Config stringId The AWS Assigned deployment config id
- id string
- The provider-assigned unique ID for this managed resource.
- deployment_
config_ strid The AWS Assigned deployment config id
- id str
- The provider-assigned unique ID for this managed resource.
Look up an Existing DeploymentConfig Resource
Get an existing DeploymentConfig resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: DeploymentConfigState, opts?: CustomResourceOptions): DeploymentConfigstatic get(resource_name, id, opts=None, compute_platform=None, deployment_config_id=None, deployment_config_name=None, minimum_healthy_hosts=None, traffic_routing_config=None, __props__=None);func GetDeploymentConfig(ctx *Context, name string, id IDInput, state *DeploymentConfigState, opts ...ResourceOption) (*DeploymentConfig, error)public static DeploymentConfig Get(string name, Input<string> id, DeploymentConfigState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Compute
Platform string The compute platform can be
Server,Lambda, orECS. Default isServer.- Deployment
Config stringId The AWS Assigned deployment config id
- Deployment
Config stringName The name of the deployment config.
- Minimum
Healthy DeploymentHosts Config Minimum Healthy Hosts Args A minimum_healthy_hosts block. Required for
Servercompute platform. Minimum Healthy Hosts are documented below.- Traffic
Routing DeploymentConfig Config Traffic Routing Config Args A traffic_routing_config block. Traffic Routing Config is documented below.
- Compute
Platform string The compute platform can be
Server,Lambda, orECS. Default isServer.- Deployment
Config stringId The AWS Assigned deployment config id
- Deployment
Config stringName The name of the deployment config.
- Minimum
Healthy DeploymentHosts Config Minimum Healthy Hosts A minimum_healthy_hosts block. Required for
Servercompute platform. Minimum Healthy Hosts are documented below.- Traffic
Routing DeploymentConfig Config Traffic Routing Config A traffic_routing_config block. Traffic Routing Config is documented below.
- compute
Platform string The compute platform can be
Server,Lambda, orECS. Default isServer.- deployment
Config stringId The AWS Assigned deployment config id
- deployment
Config stringName The name of the deployment config.
- minimum
Healthy DeploymentHosts Config Minimum Healthy Hosts A minimum_healthy_hosts block. Required for
Servercompute platform. Minimum Healthy Hosts are documented below.- traffic
Routing DeploymentConfig Config Traffic Routing Config A traffic_routing_config block. Traffic Routing Config is documented below.
- compute_
platform str The compute platform can be
Server,Lambda, orECS. Default isServer.- deployment_
config_ strid The AWS Assigned deployment config id
- deployment_
config_ strname The name of the deployment config.
- minimum_
healthy_ Dict[Deploymenthosts Config Minimum Healthy Hosts] A minimum_healthy_hosts block. Required for
Servercompute platform. Minimum Healthy Hosts are documented below.- traffic_
routing_ Dict[Deploymentconfig Config Traffic Routing Config] A traffic_routing_config block. Traffic Routing Config is documented below.
Supporting Types
DeploymentConfigMinimumHealthyHosts
- Type string
The type can either be
FLEET_PERCENTorHOST_COUNT.- Value int
The value when the type is
FLEET_PERCENTrepresents 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.
- Type string
The type can either be
FLEET_PERCENTorHOST_COUNT.- Value int
The value when the type is
FLEET_PERCENTrepresents 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.
- type string
The type can either be
FLEET_PERCENTorHOST_COUNT.- value number
The value when the type is
FLEET_PERCENTrepresents 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.
- type str
The type can either be
FLEET_PERCENTorHOST_COUNT.- value float
The value when the type is
FLEET_PERCENTrepresents 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.
DeploymentConfigTrafficRoutingConfig
- Time
Based DeploymentCanary Config Traffic Routing Config Time Based Canary Args The time based canary configuration information. If
typeisTimeBasedLinear, usetime_based_linearinstead.- Time
Based DeploymentLinear Config Traffic Routing Config Time Based Linear Args The time based linear configuration information. If
typeisTimeBasedCanary, usetime_based_canaryinstead.- Type string
Type of traffic routing config. One of
TimeBasedCanary,TimeBasedLinear,AllAtOnce.
- Time
Based DeploymentCanary Config Traffic Routing Config Time Based Canary The time based canary configuration information. If
typeisTimeBasedLinear, usetime_based_linearinstead.- Time
Based DeploymentLinear Config Traffic Routing Config Time Based Linear The time based linear configuration information. If
typeisTimeBasedCanary, usetime_based_canaryinstead.- Type string
Type of traffic routing config. One of
TimeBasedCanary,TimeBasedLinear,AllAtOnce.
- time
Based DeploymentCanary Config Traffic Routing Config Time Based Canary The time based canary configuration information. If
typeisTimeBasedLinear, usetime_based_linearinstead.- time
Based DeploymentLinear Config Traffic Routing Config Time Based Linear The time based linear configuration information. If
typeisTimeBasedCanary, usetime_based_canaryinstead.- type string
Type of traffic routing config. One of
TimeBasedCanary,TimeBasedLinear,AllAtOnce.
- time
Based Dict[DeploymentCanary Config Traffic Routing Config Time Based Canary] The time based canary configuration information. If
typeisTimeBasedLinear, usetime_based_linearinstead.- time
Based Dict[DeploymentLinear Config Traffic Routing Config Time Based Linear] The time based linear configuration information. If
typeisTimeBasedCanary, usetime_based_canaryinstead.- type str
Type of traffic routing config. One of
TimeBasedCanary,TimeBasedLinear,AllAtOnce.
DeploymentConfigTrafficRoutingConfigTimeBasedCanary
- Interval int
The number of minutes between the first and second traffic shifts of a
TimeBasedCanarydeployment.- Percentage int
The percentage of traffic to shift in the first increment of a
TimeBasedCanarydeployment.
- Interval int
The number of minutes between the first and second traffic shifts of a
TimeBasedCanarydeployment.- Percentage int
The percentage of traffic to shift in the first increment of a
TimeBasedCanarydeployment.
- interval number
The number of minutes between the first and second traffic shifts of a
TimeBasedCanarydeployment.- percentage number
The percentage of traffic to shift in the first increment of a
TimeBasedCanarydeployment.
- interval float
The number of minutes between the first and second traffic shifts of a
TimeBasedCanarydeployment.- percentage float
The percentage of traffic to shift in the first increment of a
TimeBasedCanarydeployment.
DeploymentConfigTrafficRoutingConfigTimeBasedLinear
- Interval int
The number of minutes between each incremental traffic shift of a
TimeBasedLineardeployment.- Percentage int
The percentage of traffic that is shifted at the start of each increment of a
TimeBasedLineardeployment.
- Interval int
The number of minutes between each incremental traffic shift of a
TimeBasedLineardeployment.- Percentage int
The percentage of traffic that is shifted at the start of each increment of a
TimeBasedLineardeployment.
- interval number
The number of minutes between each incremental traffic shift of a
TimeBasedLineardeployment.- percentage number
The percentage of traffic that is shifted at the start of each increment of a
TimeBasedLineardeployment.
- interval float
The number of minutes between each incremental traffic shift of a
TimeBasedLineardeployment.- percentage float
The percentage of traffic that is shifted at the start of each increment of a
TimeBasedLineardeployment.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.