Class: AWSCDK::ECS::ForceNewDeployment
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ECS::ForceNewDeployment
- Defined in:
- ecs/force_new_deployment.rb
Overview
Configuration for forcing a new deployment of the service.
Instance Attribute Summary collapse
-
#enabled ⇒ Boolean
readonly
Whether to enable the force-new-deployment mechanism for the service.
-
#nonce ⇒ String?
readonly
A unique nonce value that signals Amazon ECS to start a new deployment.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(enabled:, nonce: nil) ⇒ ForceNewDeployment
constructor
A new instance of ForceNewDeployment.
- #to_jsii ⇒ Object
Constructor Details
#initialize(enabled:, nonce: nil) ⇒ ForceNewDeployment
Returns a new instance of ForceNewDeployment.
9 10 11 12 13 14 |
# File 'ecs/force_new_deployment.rb', line 9 def initialize(enabled:, nonce: nil) @enabled = enabled Jsii::Type.check_type(@enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enabled") @nonce = nonce Jsii::Type.check_type(@nonce, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "nonce") unless @nonce.nil? end |
Instance Attribute Details
#enabled ⇒ Boolean (readonly)
Whether to enable the force-new-deployment mechanism for the service.
Setting this to true enables the mechanism, but on its own it does not
force a new deployment on every cdk deploy: CloudFormation only starts a
new deployment when it detects a change in the template, and the signal for
that is the nonce value changing between deployments. If nonce is not
provided or its value stays the same across deployments, no new deployment
is forced. When set to false, the ForceNewDeployment property is rendered
with EnableForceNewDeployment: false.
To force a new deployment on every cdk deploy, provide a nonce with a
unique, time-varying value such as a timestamp, random string, or sequence
number (e.g. Date.now().toString()).
32 33 34 |
# File 'ecs/force_new_deployment.rb', line 32 def enabled @enabled end |
#nonce ⇒ String? (readonly)
Default: - no nonce
A unique nonce value that signals Amazon ECS to start a new deployment.
When you change this value, it triggers a new deployment even though no other service parameters have changed. Use a stable, time-varying value like a commit hash, image digest, or version string.
If not provided and enabled is true, only EnableForceNewDeployment
is set without a nonce.
Must be between 1 and 255 characters.
46 47 48 |
# File 'ecs/force_new_deployment.rb', line 46 def nonce @nonce end |
Class Method Details
.jsii_properties ⇒ Object
48 49 50 51 52 53 |
# File 'ecs/force_new_deployment.rb', line 48 def self.jsii_properties { :enabled => "enabled", :nonce => "nonce", } end |
Instance Method Details
#to_jsii ⇒ Object
55 56 57 58 59 60 61 62 |
# File 'ecs/force_new_deployment.rb', line 55 def to_jsii result = {} result.merge!({ "enabled" => @enabled, "nonce" => @nonce, }) result.compact end |