Class: AWSCDK::StepFunctions::CfnStateMachineAliasProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
step_functions/cfn_state_machine_alias_props.rb

Overview

Properties for defining a CfnStateMachineAlias.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(deployment_preference: nil, description: nil, name: nil, routing_configuration: nil, state_machine_arn: nil) ⇒ CfnStateMachineAliasProps

Returns a new instance of CfnStateMachineAliasProps.

Parameters:



14
15
16
17
18
19
20
21
22
23
24
25
# File 'step_functions/cfn_state_machine_alias_props.rb', line 14

def initialize(deployment_preference: nil, description: nil, name: nil, routing_configuration: nil, state_machine_arn: nil)
  @deployment_preference = deployment_preference.is_a?(Hash) ? ::AWSCDK::StepFunctions::CfnStateMachineAlias::DeploymentPreferenceProperty.new(**deployment_preference.transform_keys(&:to_sym)) : deployment_preference
  Jsii::Type.check_type(@deployment_preference, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zdGVwZnVuY3Rpb25zLkNmblN0YXRlTWFjaGluZUFsaWFzLkRlcGxveW1lbnRQcmVmZXJlbmNlUHJvcGVydHkifV19fQ==")), "deploymentPreference") unless @deployment_preference.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
  @routing_configuration = routing_configuration
  Jsii::Type.check_type(@routing_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9ucy5DZm5TdGF0ZU1hY2hpbmVBbGlhcy5Sb3V0aW5nQ29uZmlndXJhdGlvblZlcnNpb25Qcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "routingConfiguration") unless @routing_configuration.nil?
  @state_machine_arn = state_machine_arn
  Jsii::Type.check_type(@state_machine_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "stateMachineArn") unless @state_machine_arn.nil?
end

Instance Attribute Details

#deployment_preferenceAWSCDK::IResolvable, ... (readonly)

The settings that enable gradual state machine deployments.

These settings include Alarms , Interval , Percentage , StateMachineVersionArn , and Type .

CloudFormation automatically shifts traffic from the version an alias currently points to, to a new state machine version that you specify.

RoutingConfiguration and DeploymentPreference are mutually exclusive properties. You must define only one of these properties.

Based on the type of deployment you want to perform, you can specify one of the following settings:

  • LINEAR - Shifts traffic to the new version in equal increments with an equal number of minutes between each increment.

For example, if you specify the increment percent as 20 with an interval of 600 minutes, this deployment increases traffic by 20 percent every 600 minutes until the new version receives 100 percent of the traffic. This deployment immediately rolls back the new version if any Amazon CloudWatch alarms are triggered.

  • ALL_AT_ONCE - Shifts 100 percent of traffic to the new version immediately. CloudFormation monitors the new version and rolls it back automatically to the previous version if any CloudWatch alarms are triggered.
  • CANARY - Shifts traffic in two increments.

In the first increment, a small percentage of traffic, for example, 10 percent is shifted to the new version. In the second increment, before a specified time interval in seconds gets over, the remaining traffic is shifted to the new version. The shift to the new version for the remaining traffic takes place only if no CloudWatch alarms are triggered during the specified time interval.



48
49
50
# File 'step_functions/cfn_state_machine_alias_props.rb', line 48

def deployment_preference
  @deployment_preference
end

#descriptionString? (readonly)

An optional description of the state machine alias.



53
54
55
# File 'step_functions/cfn_state_machine_alias_props.rb', line 53

def description
  @description
end

#nameString? (readonly)

The name of the state machine alias.

If you don't provide a name, it uses an automatically generated name based on the logical ID.



60
61
62
# File 'step_functions/cfn_state_machine_alias_props.rb', line 60

def name
  @name
end

#routing_configurationAWSCDK::IResolvable, ... (readonly)

The routing configuration of an alias.

Routing configuration splits StartExecution requests between one or two versions of the same state machine.

Use RoutingConfiguration if you want to explicitly set the alias weights . Weight is the percentage of traffic you want to route to a state machine version.

RoutingConfiguration and DeploymentPreference are mutually exclusive properties. You must define only one of these properties.



71
72
73
# File 'step_functions/cfn_state_machine_alias_props.rb', line 71

def routing_configuration
  @routing_configuration
end

#state_machine_arnString? (readonly)



74
75
76
# File 'step_functions/cfn_state_machine_alias_props.rb', line 74

def state_machine_arn
  @state_machine_arn
end

Class Method Details

.jsii_propertiesObject



76
77
78
79
80
81
82
83
84
# File 'step_functions/cfn_state_machine_alias_props.rb', line 76

def self.jsii_properties
  {
    :deployment_preference => "deploymentPreference",
    :description => "description",
    :name => "name",
    :routing_configuration => "routingConfiguration",
    :state_machine_arn => "stateMachineArn",
  }
end

Instance Method Details

#to_jsiiObject



86
87
88
89
90
91
92
93
94
95
96
# File 'step_functions/cfn_state_machine_alias_props.rb', line 86

def to_jsii
  result = {}
  result.merge!({
    "deploymentPreference" => @deployment_preference,
    "description" => @description,
    "name" => @name,
    "routingConfiguration" => @routing_configuration,
    "stateMachineArn" => @state_machine_arn,
  })
  result.compact
end