@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
472 lines (471 loc) • 20.4 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Provides a CodeDeploy Deployment Group for a CodeDeploy Application
*
* > **NOTE on blue/green deployments:** When using `greenFleetProvisioningOption` with the `COPY_AUTO_SCALING_GROUP` action, 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 as `DISCOVER_EXISTING` with separate blue and green ASG.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const assumeRole = aws.iam.getPolicyDocument({
* statements: [{
* effect: "Allow",
* principals: [{
* type: "Service",
* identifiers: ["codedeploy.amazonaws.com"],
* }],
* actions: ["sts:AssumeRole"],
* }],
* });
* const example = new aws.iam.Role("example", {
* name: "example-role",
* assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json),
* });
* const aWSCodeDeployRole = new aws.iam.RolePolicyAttachment("AWSCodeDeployRole", {
* policyArn: "arn:aws:iam::aws:policy/service-role/AWSCodeDeployRole",
* role: example.name,
* });
* const exampleApplication = new aws.codedeploy.Application("example", {name: "example-app"});
* const exampleTopic = new aws.sns.Topic("example", {name: "example-topic"});
* const exampleDeploymentGroup = new aws.codedeploy.DeploymentGroup("example", {
* appName: exampleApplication.name,
* deploymentGroupName: "example-group",
* serviceRoleArn: example.arn,
* ec2TagSets: [{
* ec2TagFilters: [
* {
* key: "filterkey1",
* type: "KEY_AND_VALUE",
* value: "filtervalue",
* },
* {
* key: "filterkey2",
* type: "KEY_AND_VALUE",
* value: "filtervalue",
* },
* ],
* }],
* triggerConfigurations: [{
* triggerEvents: ["DeploymentFailure"],
* triggerName: "example-trigger",
* triggerTargetArn: exampleTopic.arn,
* }],
* autoRollbackConfiguration: {
* enabled: true,
* events: ["DEPLOYMENT_FAILURE"],
* },
* alarmConfiguration: {
* alarms: ["my-alarm-name"],
* enabled: true,
* },
* outdatedInstancesStrategy: "UPDATE",
* });
* ```
*
* ### Blue Green Deployments with ECS
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.codedeploy.Application("example", {
* computePlatform: "ECS",
* name: "example",
* });
* const exampleDeploymentGroup = new aws.codedeploy.DeploymentGroup("example", {
* appName: example.name,
* deploymentConfigName: "CodeDeployDefault.ECSAllAtOnce",
* deploymentGroupName: "example",
* serviceRoleArn: exampleAwsIamRole.arn,
* autoRollbackConfiguration: {
* enabled: true,
* events: ["DEPLOYMENT_FAILURE"],
* },
* blueGreenDeploymentConfig: {
* deploymentReadyOption: {
* actionOnTimeout: "CONTINUE_DEPLOYMENT",
* },
* terminateBlueInstancesOnDeploymentSuccess: {
* action: "TERMINATE",
* terminationWaitTimeInMinutes: 5,
* },
* },
* deploymentStyle: {
* deploymentOption: "WITH_TRAFFIC_CONTROL",
* deploymentType: "BLUE_GREEN",
* },
* ecsService: {
* clusterName: exampleAwsEcsCluster.name,
* serviceName: exampleAwsEcsService.name,
* },
* loadBalancerInfo: {
* targetGroupPairInfo: {
* prodTrafficRoute: {
* listenerArns: [exampleAwsLbListener.arn],
* },
* targetGroups: [
* {
* name: blue.name,
* },
* {
* name: green.name,
* },
* ],
* },
* },
* });
* ```
*
* ### Blue Green Deployments with Servers and Classic ELB
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.codedeploy.Application("example", {name: "example-app"});
* const exampleDeploymentGroup = new aws.codedeploy.DeploymentGroup("example", {
* appName: example.name,
* deploymentGroupName: "example-group",
* serviceRoleArn: exampleAwsIamRole.arn,
* deploymentStyle: {
* deploymentOption: "WITH_TRAFFIC_CONTROL",
* deploymentType: "BLUE_GREEN",
* },
* loadBalancerInfo: {
* elbInfos: [{
* name: exampleAwsElb.name,
* }],
* },
* blueGreenDeploymentConfig: {
* deploymentReadyOption: {
* actionOnTimeout: "STOP_DEPLOYMENT",
* waitTimeInMinutes: 60,
* },
* greenFleetProvisioningOption: {
* action: "DISCOVER_EXISTING",
* },
* terminateBlueInstancesOnDeploymentSuccess: {
* action: "KEEP_ALIVE",
* },
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import CodeDeploy Deployment Groups using `app_name`, a colon, and `deployment_group_name`. For example:
*
* ```sh
* $ pulumi import aws:codedeploy/deploymentGroup:DeploymentGroup example my-application:my-deployment-group
* ```
*/
export declare class DeploymentGroup extends pulumi.CustomResource {
/**
* Get an existing DeploymentGroup resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DeploymentGroupState, opts?: pulumi.CustomResourceOptions): DeploymentGroup;
/**
* Returns 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.
*/
static isInstance(obj: any): obj is DeploymentGroup;
/**
* Configuration block of alarms associated with the deployment group (documented below).
*/
readonly alarmConfiguration: pulumi.Output<outputs.codedeploy.DeploymentGroupAlarmConfiguration | undefined>;
/**
* The name of the application.
*/
readonly appName: pulumi.Output<string>;
/**
* The ARN of the CodeDeploy deployment group.
*/
readonly arn: pulumi.Output<string>;
/**
* Configuration block of the automatic rollback configuration associated with the deployment group (documented below).
*/
readonly autoRollbackConfiguration: pulumi.Output<outputs.codedeploy.DeploymentGroupAutoRollbackConfiguration | undefined>;
/**
* Autoscaling groups associated with the deployment group.
*/
readonly autoscalingGroups: pulumi.Output<string[] | undefined>;
/**
* Configuration block of the blue/green deployment options for a deployment group (documented below).
*/
readonly blueGreenDeploymentConfig: pulumi.Output<outputs.codedeploy.DeploymentGroupBlueGreenDeploymentConfig>;
/**
* The destination platform type for the deployment.
*/
readonly computePlatform: pulumi.Output<string>;
/**
* The name of the group's deployment config. The default is "CodeDeployDefault.OneAtATime".
*/
readonly deploymentConfigName: pulumi.Output<string | undefined>;
/**
* The ID of the CodeDeploy deployment group.
*/
readonly deploymentGroupId: pulumi.Output<string>;
/**
* The name of the deployment group.
*/
readonly deploymentGroupName: pulumi.Output<string>;
/**
* 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).
*/
readonly deploymentStyle: pulumi.Output<outputs.codedeploy.DeploymentGroupDeploymentStyle | undefined>;
/**
* Tag filters associated with the deployment group. See the AWS docs for details.
*/
readonly ec2TagFilters: pulumi.Output<outputs.codedeploy.DeploymentGroupEc2TagFilter[] | 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.
*/
readonly ec2TagSets: pulumi.Output<outputs.codedeploy.DeploymentGroupEc2TagSet[] | undefined>;
/**
* Configuration block(s) of the ECS services for a deployment group (documented below).
*/
readonly ecsService: pulumi.Output<outputs.codedeploy.DeploymentGroupEcsService | undefined>;
/**
* Single configuration block of the load balancer to use in a blue/green deployment (documented below).
*/
readonly loadBalancerInfo: pulumi.Output<outputs.codedeploy.DeploymentGroupLoadBalancerInfo | undefined>;
/**
* On premise tag filters associated with the group. See the AWS docs for details.
*/
readonly onPremisesInstanceTagFilters: pulumi.Output<outputs.codedeploy.DeploymentGroupOnPremisesInstanceTagFilter[] | undefined>;
/**
* Configuration block of Indicates what happens when new Amazon EC2 instances are launched mid-deployment and do not receive the deployed application revision. Valid values are `UPDATE` and `IGNORE`. Defaults to `UPDATE`.
*/
readonly outdatedInstancesStrategy: pulumi.Output<string | undefined>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
readonly region: pulumi.Output<string>;
/**
* The service role ARN that allows deployments.
*/
readonly serviceRoleArn: pulumi.Output<string>;
/**
* Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
readonly tags: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
*/
readonly tagsAll: pulumi.Output<{
[key: string]: string;
}>;
/**
* Indicates whether the deployment group was configured to have CodeDeploy install a termination hook into an Auto Scaling group.
*/
readonly terminationHookEnabled: pulumi.Output<boolean | undefined>;
/**
* Configuration block(s) of the triggers for the deployment group (documented below).
*/
readonly triggerConfigurations: pulumi.Output<outputs.codedeploy.DeploymentGroupTriggerConfiguration[] | undefined>;
/**
* Create a DeploymentGroup resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: DeploymentGroupArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering DeploymentGroup resources.
*/
export interface DeploymentGroupState {
/**
* Configuration block of alarms associated with the deployment group (documented below).
*/
alarmConfiguration?: pulumi.Input<inputs.codedeploy.DeploymentGroupAlarmConfiguration>;
/**
* The name of the application.
*/
appName?: pulumi.Input<string>;
/**
* The ARN of the CodeDeploy deployment group.
*/
arn?: pulumi.Input<string>;
/**
* Configuration block of the automatic rollback configuration associated with the deployment group (documented below).
*/
autoRollbackConfiguration?: pulumi.Input<inputs.codedeploy.DeploymentGroupAutoRollbackConfiguration>;
/**
* Autoscaling groups associated with the deployment group.
*/
autoscalingGroups?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Configuration block of the blue/green deployment options for a deployment group (documented below).
*/
blueGreenDeploymentConfig?: pulumi.Input<inputs.codedeploy.DeploymentGroupBlueGreenDeploymentConfig>;
/**
* The destination platform type for the deployment.
*/
computePlatform?: pulumi.Input<string>;
/**
* The name of the group's deployment config. The default is "CodeDeployDefault.OneAtATime".
*/
deploymentConfigName?: pulumi.Input<string>;
/**
* The ID of the CodeDeploy deployment group.
*/
deploymentGroupId?: pulumi.Input<string>;
/**
* The name of the deployment group.
*/
deploymentGroupName?: pulumi.Input<string>;
/**
* 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).
*/
deploymentStyle?: pulumi.Input<inputs.codedeploy.DeploymentGroupDeploymentStyle>;
/**
* Tag filters associated with the deployment group. See the AWS docs for details.
*/
ec2TagFilters?: pulumi.Input<pulumi.Input<inputs.codedeploy.DeploymentGroupEc2TagFilter>[]>;
/**
* 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.
*/
ec2TagSets?: pulumi.Input<pulumi.Input<inputs.codedeploy.DeploymentGroupEc2TagSet>[]>;
/**
* Configuration block(s) of the ECS services for a deployment group (documented below).
*/
ecsService?: pulumi.Input<inputs.codedeploy.DeploymentGroupEcsService>;
/**
* Single configuration block of the load balancer to use in a blue/green deployment (documented below).
*/
loadBalancerInfo?: pulumi.Input<inputs.codedeploy.DeploymentGroupLoadBalancerInfo>;
/**
* On premise tag filters associated with the group. See the AWS docs for details.
*/
onPremisesInstanceTagFilters?: pulumi.Input<pulumi.Input<inputs.codedeploy.DeploymentGroupOnPremisesInstanceTagFilter>[]>;
/**
* Configuration block of Indicates what happens when new Amazon EC2 instances are launched mid-deployment and do not receive the deployed application revision. Valid values are `UPDATE` and `IGNORE`. Defaults to `UPDATE`.
*/
outdatedInstancesStrategy?: pulumi.Input<string>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
region?: pulumi.Input<string>;
/**
* The service role ARN that allows deployments.
*/
serviceRoleArn?: pulumi.Input<string>;
/**
* Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
*/
tagsAll?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Indicates whether the deployment group was configured to have CodeDeploy install a termination hook into an Auto Scaling group.
*/
terminationHookEnabled?: pulumi.Input<boolean>;
/**
* Configuration block(s) of the triggers for the deployment group (documented below).
*/
triggerConfigurations?: pulumi.Input<pulumi.Input<inputs.codedeploy.DeploymentGroupTriggerConfiguration>[]>;
}
/**
* The set of arguments for constructing a DeploymentGroup resource.
*/
export interface DeploymentGroupArgs {
/**
* Configuration block of alarms associated with the deployment group (documented below).
*/
alarmConfiguration?: pulumi.Input<inputs.codedeploy.DeploymentGroupAlarmConfiguration>;
/**
* The name of the application.
*/
appName: pulumi.Input<string>;
/**
* Configuration block of the automatic rollback configuration associated with the deployment group (documented below).
*/
autoRollbackConfiguration?: pulumi.Input<inputs.codedeploy.DeploymentGroupAutoRollbackConfiguration>;
/**
* Autoscaling groups associated with the deployment group.
*/
autoscalingGroups?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Configuration block of the blue/green deployment options for a deployment group (documented below).
*/
blueGreenDeploymentConfig?: pulumi.Input<inputs.codedeploy.DeploymentGroupBlueGreenDeploymentConfig>;
/**
* The name of the group's deployment config. The default is "CodeDeployDefault.OneAtATime".
*/
deploymentConfigName?: pulumi.Input<string>;
/**
* The name of the deployment group.
*/
deploymentGroupName: pulumi.Input<string>;
/**
* 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).
*/
deploymentStyle?: pulumi.Input<inputs.codedeploy.DeploymentGroupDeploymentStyle>;
/**
* Tag filters associated with the deployment group. See the AWS docs for details.
*/
ec2TagFilters?: pulumi.Input<pulumi.Input<inputs.codedeploy.DeploymentGroupEc2TagFilter>[]>;
/**
* 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.
*/
ec2TagSets?: pulumi.Input<pulumi.Input<inputs.codedeploy.DeploymentGroupEc2TagSet>[]>;
/**
* Configuration block(s) of the ECS services for a deployment group (documented below).
*/
ecsService?: pulumi.Input<inputs.codedeploy.DeploymentGroupEcsService>;
/**
* Single configuration block of the load balancer to use in a blue/green deployment (documented below).
*/
loadBalancerInfo?: pulumi.Input<inputs.codedeploy.DeploymentGroupLoadBalancerInfo>;
/**
* On premise tag filters associated with the group. See the AWS docs for details.
*/
onPremisesInstanceTagFilters?: pulumi.Input<pulumi.Input<inputs.codedeploy.DeploymentGroupOnPremisesInstanceTagFilter>[]>;
/**
* Configuration block of Indicates what happens when new Amazon EC2 instances are launched mid-deployment and do not receive the deployed application revision. Valid values are `UPDATE` and `IGNORE`. Defaults to `UPDATE`.
*/
outdatedInstancesStrategy?: pulumi.Input<string>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
region?: pulumi.Input<string>;
/**
* The service role ARN that allows deployments.
*/
serviceRoleArn: pulumi.Input<string>;
/**
* Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Indicates whether the deployment group was configured to have CodeDeploy install a termination hook into an Auto Scaling group.
*/
terminationHookEnabled?: pulumi.Input<boolean>;
/**
* Configuration block(s) of the triggers for the deployment group (documented below).
*/
triggerConfigurations?: pulumi.Input<pulumi.Input<inputs.codedeploy.DeploymentGroupTriggerConfiguration>[]>;
}