Exemplo n.º 1
0
 public MyStack()
 {
     var exampleApplication = new Aws.CodeDeploy.Application("exampleApplication", new Aws.CodeDeploy.ApplicationArgs
     {
         ComputePlatform = "ECS",
     });
     var exampleDeploymentGroup = new Aws.CodeDeploy.DeploymentGroup("exampleDeploymentGroup", new Aws.CodeDeploy.DeploymentGroupArgs
     {
         AppName = exampleApplication.Name,
         AutoRollbackConfiguration = new Aws.CodeDeploy.Inputs.DeploymentGroupAutoRollbackConfigurationArgs
         {
             Enabled = true,
             Events  =
             {
                 "DEPLOYMENT_FAILURE",
             },
         },
         BlueGreenDeploymentConfig = new Aws.CodeDeploy.Inputs.DeploymentGroupBlueGreenDeploymentConfigArgs
         {
             DeploymentReadyOption = new Aws.CodeDeploy.Inputs.DeploymentGroupBlueGreenDeploymentConfigDeploymentReadyOptionArgs
             {
                 ActionOnTimeout = "CONTINUE_DEPLOYMENT",
             },
             TerminateBlueInstancesOnDeploymentSuccess = new Aws.CodeDeploy.Inputs.DeploymentGroupBlueGreenDeploymentConfigTerminateBlueInstancesOnDeploymentSuccessArgs
             {
                 Action = "TERMINATE",
                 TerminationWaitTimeInMinutes = 5,
             },
         },
         DeploymentConfigName = "CodeDeployDefault.ECSAllAtOnce",
         DeploymentGroupName  = "example",
         DeploymentStyle      = new Aws.CodeDeploy.Inputs.DeploymentGroupDeploymentStyleArgs
         {
             DeploymentOption = "WITH_TRAFFIC_CONTROL",
             DeploymentType   = "BLUE_GREEN",
         },
         EcsService = new Aws.CodeDeploy.Inputs.DeploymentGroupEcsServiceArgs
         {
             ClusterName = aws_ecs_cluster.Example.Name,
             ServiceName = aws_ecs_service.Example.Name,
         },
         LoadBalancerInfo = new Aws.CodeDeploy.Inputs.DeploymentGroupLoadBalancerInfoArgs
         {
             TargetGroupPairInfo = new Aws.CodeDeploy.Inputs.DeploymentGroupLoadBalancerInfoTargetGroupPairInfoArgs
             {
                 ProdTrafficRoute = new Aws.CodeDeploy.Inputs.DeploymentGroupLoadBalancerInfoTargetGroupPairInfoProdTrafficRouteArgs
                 {
                     ListenerArns =
                     {
                         aws_lb_listener.Example.Arn,
                     },
                 },
                 TargetGroup =
                 {
                     {
                         { "name", aws_lb_target_group.Blue.Name  },
                     },
Exemplo n.º 2
0
 public MyStack()
 {
     var exampleApplication = new Aws.CodeDeploy.Application("exampleApplication", new Aws.CodeDeploy.ApplicationArgs
     {
     });
     var exampleDeploymentGroup = new Aws.CodeDeploy.DeploymentGroup("exampleDeploymentGroup", new Aws.CodeDeploy.DeploymentGroupArgs
     {
         AppName = exampleApplication.Name,
         BlueGreenDeploymentConfig = new Aws.CodeDeploy.Inputs.DeploymentGroupBlueGreenDeploymentConfigArgs
         {
             DeploymentReadyOption = new Aws.CodeDeploy.Inputs.DeploymentGroupBlueGreenDeploymentConfigDeploymentReadyOptionArgs
             {
                 ActionOnTimeout   = "STOP_DEPLOYMENT",
                 WaitTimeInMinutes = 60,
             },
             GreenFleetProvisioningOption = new Aws.CodeDeploy.Inputs.DeploymentGroupBlueGreenDeploymentConfigGreenFleetProvisioningOptionArgs
             {
                 Action = "DISCOVER_EXISTING",
             },
             TerminateBlueInstancesOnDeploymentSuccess = new Aws.CodeDeploy.Inputs.DeploymentGroupBlueGreenDeploymentConfigTerminateBlueInstancesOnDeploymentSuccessArgs
             {
                 Action = "KEEP_ALIVE",
             },
         },
         DeploymentGroupName = "example-group",
         DeploymentStyle     = new Aws.CodeDeploy.Inputs.DeploymentGroupDeploymentStyleArgs
         {
             DeploymentOption = "WITH_TRAFFIC_CONTROL",
             DeploymentType   = "BLUE_GREEN",
         },
         LoadBalancerInfo = new Aws.CodeDeploy.Inputs.DeploymentGroupLoadBalancerInfoArgs
         {
             ElbInfo =
             {
                 {
                     { "name", aws_elb.Example.Name },
                 },
             },
         },