Class: AWSCDK::CodeDeploy::ECSBlueGreenDeploymentConfig
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CodeDeploy::ECSBlueGreenDeploymentConfig
- Defined in:
- code_deploy/ecs_blue_green_deployment_config.rb
Overview
Specify how the deployment behaves and how traffic is routed to the ECS service during a blue-green ECS deployment.
Instance Attribute Summary collapse
-
#blue_target_group ⇒ AWSCDK::ElasticLoadBalancingv2::ITargetGroup
readonly
The target group that will be associated with the 'blue' ECS task set during a blue-green deployment.
-
#deployment_approval_wait_time ⇒ AWSCDK::Duration?
readonly
Specify how long CodeDeploy waits for approval to continue a blue-green deployment before it stops the deployment.
-
#green_target_group ⇒ AWSCDK::ElasticLoadBalancingv2::ITargetGroup
readonly
The target group that will be associated with the 'green' ECS task set during a blue-green deployment.
-
#listener ⇒ AWSCDK::Interfaces::AWSElasticloadbalancingv2::IListenerRef
readonly
The load balancer listener used to serve production traffic and to shift production traffic from the 'blue' ECS task set to the 'green' ECS task set during a blue-green deployment.
-
#termination_wait_time ⇒ AWSCDK::Duration?
readonly
Specify how long CodeDeploy waits before it terminates the original 'blue' ECS task set when a blue-green deployment is complete.
-
#test_listener ⇒ AWSCDK::Interfaces::AWSElasticloadbalancingv2::IListenerRef?
readonly
The load balancer listener used to route test traffic to the 'green' ECS task set during a blue-green deployment.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(blue_target_group:, green_target_group:, listener:, deployment_approval_wait_time: nil, termination_wait_time: nil, test_listener: nil) ⇒ ECSBlueGreenDeploymentConfig
constructor
A new instance of ECSBlueGreenDeploymentConfig.
- #to_jsii ⇒ Object
Constructor Details
#initialize(blue_target_group:, green_target_group:, listener:, deployment_approval_wait_time: nil, termination_wait_time: nil, test_listener: nil) ⇒ ECSBlueGreenDeploymentConfig
Returns a new instance of ECSBlueGreenDeploymentConfig.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'code_deploy/ecs_blue_green_deployment_config.rb', line 15 def initialize(blue_target_group:, green_target_group:, listener:, deployment_approval_wait_time: nil, termination_wait_time: nil, test_listener: nil) @blue_target_group = blue_target_group Jsii::Type.check_type(@blue_target_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5JVGFyZ2V0R3JvdXAifQ==")), "blueTargetGroup") @green_target_group = green_target_group Jsii::Type.check_type(@green_target_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5JVGFyZ2V0R3JvdXAifQ==")), "greenTargetGroup") @listener = listener Jsii::Type.check_type(@listener, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZ3YyLklMaXN0ZW5lclJlZiJ9")), "listener") @deployment_approval_wait_time = deployment_approval_wait_time Jsii::Type.check_type(@deployment_approval_wait_time, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "deploymentApprovalWaitTime") unless @deployment_approval_wait_time.nil? @termination_wait_time = termination_wait_time Jsii::Type.check_type(@termination_wait_time, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "terminationWaitTime") unless @termination_wait_time.nil? @test_listener = test_listener Jsii::Type.check_type(@test_listener, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZ3YyLklMaXN0ZW5lclJlZiJ9")), "testListener") unless @test_listener.nil? end |
Instance Attribute Details
#blue_target_group ⇒ AWSCDK::ElasticLoadBalancingv2::ITargetGroup (readonly)
The target group that will be associated with the 'blue' ECS task set during a blue-green deployment.
33 34 35 |
# File 'code_deploy/ecs_blue_green_deployment_config.rb', line 33 def blue_target_group @blue_target_group end |
#deployment_approval_wait_time ⇒ AWSCDK::Duration? (readonly)
Default: 0
Specify how long CodeDeploy waits for approval to continue a blue-green deployment before it stops the deployment.
After provisioning the 'green' ECS task set and re-routing test traffic, CodeDeploy can wait for approval before continuing the deployment and re-routing production traffic. During this wait time, validation such as manual testing or running integration tests can occur using the test traffic port, prior to exposing the new 'green' task set to production traffic. To approve the deployment, validation steps use the CodeDeploy [ContinueDeployment API(https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_ContinueDeployment.html). If the ContinueDeployment API is not called within the wait time period, CodeDeploy will stop the deployment.
By default, CodeDeploy will not wait for deployment approval. After re-routing test traffic to the 'green' ECS task set and running any 'AfterAllowTestTraffic' and 'BeforeAllowTraffic' lifecycle hooks, the deployment will immediately re-route production traffic to the 'green' ECS task set.
57 58 59 |
# File 'code_deploy/ecs_blue_green_deployment_config.rb', line 57 def deployment_approval_wait_time @deployment_approval_wait_time end |
#green_target_group ⇒ AWSCDK::ElasticLoadBalancingv2::ITargetGroup (readonly)
The target group that will be associated with the 'green' ECS task set during a blue-green deployment.
37 38 39 |
# File 'code_deploy/ecs_blue_green_deployment_config.rb', line 37 def green_target_group @green_target_group end |
#listener ⇒ AWSCDK::Interfaces::AWSElasticloadbalancingv2::IListenerRef (readonly)
The load balancer listener used to serve production traffic and to shift production traffic from the 'blue' ECS task set to the 'green' ECS task set during a blue-green deployment.
41 42 43 |
# File 'code_deploy/ecs_blue_green_deployment_config.rb', line 41 def listener @listener end |
#termination_wait_time ⇒ AWSCDK::Duration? (readonly)
Default: 0
Specify how long CodeDeploy waits before it terminates the original 'blue' ECS task set when a blue-green deployment is complete.
During this wait time, CodeDeploy will continue to monitor any CloudWatch alarms specified for the deployment group, and the deployment group can be configured to automatically roll back if those alarms fire. Once CodeDeploy begins to terminate the 'blue' ECS task set, the deployment can no longer be rolled back, manually or automatically.
By default, the deployment will immediately terminate the 'blue' ECS task set after production traffic is successfully routed to the 'green' ECS task set.
69 70 71 |
# File 'code_deploy/ecs_blue_green_deployment_config.rb', line 69 def termination_wait_time @termination_wait_time end |
#test_listener ⇒ AWSCDK::Interfaces::AWSElasticloadbalancingv2::IListenerRef? (readonly)
Default: No test listener will be added
The load balancer listener used to route test traffic to the 'green' ECS task set during a blue-green deployment.
During a blue-green deployment, validation can occur after test traffic has been re-routed and before production traffic has been re-routed to the 'green' ECS task set. You can specify one or more Lambda functions in the deployment's AppSpec file that run during the AfterAllowTestTraffic hook. The functions can run validation tests. If a validation test fails, a deployment rollback is triggered. If the validation tests succeed, the next hook in the deployment lifecycle, BeforeAllowTraffic, is triggered.
If a test listener is not specified, the deployment will proceed to routing the production listener to the 'green' ECS task set and will skip the AfterAllowTestTraffic hook.
83 84 85 |
# File 'code_deploy/ecs_blue_green_deployment_config.rb', line 83 def test_listener @test_listener end |
Class Method Details
.jsii_properties ⇒ Object
85 86 87 88 89 90 91 92 93 94 |
# File 'code_deploy/ecs_blue_green_deployment_config.rb', line 85 def self.jsii_properties { :blue_target_group => "blueTargetGroup", :green_target_group => "greenTargetGroup", :listener => "listener", :deployment_approval_wait_time => "deploymentApprovalWaitTime", :termination_wait_time => "terminationWaitTime", :test_listener => "testListener", } end |
Instance Method Details
#to_jsii ⇒ Object
96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'code_deploy/ecs_blue_green_deployment_config.rb', line 96 def to_jsii result = {} result.merge!({ "blueTargetGroup" => @blue_target_group, "greenTargetGroup" => @green_target_group, "listener" => @listener, "deploymentApprovalWaitTime" => @deployment_approval_wait_time, "terminationWaitTime" => @termination_wait_time, "testListener" => @test_listener, }) result.compact end |