Class: AWSCDK::CodePipelineActions::CloudFormationCreateUpdateStackAction

Inherits:
Action
  • Object
show all
Defined in:
code_pipeline_actions/cloud_formation_create_update_stack_action.rb

Overview

CodePipeline action to deploy a stack.

Creates the stack if the specified stack doesn't exist. If the stack exists, AWS CloudFormation updates the stack. Use this action to update existing stacks.

AWS CodePipeline won't replace the stack, and will fail deployment if the stack is in a failed state. Use ReplaceOnFailure for an action that will delete and recreate the stack to try and recover from failed states.

Use this action to automatically replace failed stacks without recovering or troubleshooting them. You would typically choose this mode for testing.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(props) ⇒ CloudFormationCreateUpdateStackAction

Returns a new instance of CloudFormationCreateUpdateStackAction.



20
21
22
23
24
# File 'code_pipeline_actions/cloud_formation_create_update_stack_action.rb', line 20

def initialize(props)
  props = props.is_a?(Hash) ? ::AWSCDK::CodePipelineActions::CloudFormationCreateUpdateStackActionProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lX2FjdGlvbnMuQ2xvdWRGb3JtYXRpb25DcmVhdGVVcGRhdGVTdGFja0FjdGlvblByb3BzIn0=")), "props")
  Jsii::Object.instance_method(:initialize).bind(self).call(props)
end

Class Method Details

.jsii_overridable_methodsObject



26
27
28
29
30
31
32
33
34
35
36
37
# File 'code_pipeline_actions/cloud_formation_create_update_stack_action.rb', line 26

def self.jsii_overridable_methods
  {
    :action_properties => { kind: :property, name: "actionProperties", is_optional: false },
    :provided_action_properties => { kind: :property, name: "providedActionProperties", is_optional: false },
    :deployment_role => { kind: :property, name: "deploymentRole", is_optional: false },
    :bind => { kind: :method, name: "bind", is_optional: false },
    :bound => { kind: :method, name: "bound", is_optional: false },
    :on_state_change => { kind: :method, name: "onStateChange", is_optional: false },
    :variable_expression => { kind: :method, name: "variableExpression", is_optional: false },
    :add_to_deployment_role_policy => { kind: :method, name: "addToDeploymentRolePolicy", is_optional: false },
  }
end

Instance Method Details

#action_propertiesAWSCDK::Codepipeline::ActionProperties

The simple properties of the Action, like its Owner, name, etc.

Note that this accessor will be called before the bind callback.



44
45
46
# File 'code_pipeline_actions/cloud_formation_create_update_stack_action.rb', line 44

def action_properties()
  jsii_get_property("actionProperties")
end

#add_to_deployment_role_policy(statement) ⇒ Boolean

Add statement to the service role assumed by CloudFormation while executing this action.

Parameters:

Returns:

  • (Boolean)


113
114
115
116
# File 'code_pipeline_actions/cloud_formation_create_update_stack_action.rb', line 113

def add_to_deployment_role_policy(statement)
  Jsii::Type.check_type(statement, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLlBvbGljeVN0YXRlbWVudCJ9")), "statement")
  jsii_call_method("addToDeploymentRolePolicy", [statement])
end

#bind(scope, stage, options) ⇒ AWSCDK::Codepipeline::ActionConfig

The callback invoked when this Action is added to a Pipeline.

Parameters:

Returns:



66
67
68
69
70
71
72
# File 'code_pipeline_actions/cloud_formation_create_update_stack_action.rb', line 66

def bind(scope, stage, options)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(stage, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lLklTdGFnZSJ9")), "stage")
  options = options.is_a?(Hash) ? ::AWSCDK::Codepipeline::ActionBindOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lLkFjdGlvbkJpbmRPcHRpb25zIn0=")), "options")
  jsii_call_method("bind", [scope, stage, options])
end

#bound(scope, stage, options) ⇒ AWSCDK::Codepipeline::ActionConfig

This is a renamed version of the IAction.bind method.

Parameters:

Returns:



80
81
82
83
84
85
86
# File 'code_pipeline_actions/cloud_formation_create_update_stack_action.rb', line 80

def bound(scope, stage, options)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(stage, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lLklTdGFnZSJ9")), "stage")
  options = options.is_a?(Hash) ? ::AWSCDK::Codepipeline::ActionBindOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lLkFjdGlvbkJpbmRPcHRpb25zIn0=")), "options")
  jsii_call_method("bound", [scope, stage, options])
end

#deployment_roleAWSCDK::IAM::IRole

Returns:



56
57
58
# File 'code_pipeline_actions/cloud_formation_create_update_stack_action.rb', line 56

def deployment_role()
  jsii_get_property("deploymentRole")
end

#on_state_change(name, target = nil, options = nil) ⇒ AWSCDK::Events::Rule

Creates an Event that will be triggered whenever the state of this Action changes.

Parameters:

Returns:



94
95
96
97
98
99
100
# File 'code_pipeline_actions/cloud_formation_create_update_stack_action.rb', line 94

def on_state_change(name, target = nil, options = nil)
  Jsii::Type.check_type(name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLklSdWxlVGFyZ2V0In0=")), "target") unless target.nil?
  options = options.is_a?(Hash) ? ::AWSCDK::Events::RuleProps.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLlJ1bGVQcm9wcyJ9")), "options") unless options.nil?
  jsii_call_method("onStateChange", [name, target, options])
end

#provided_action_propertiesAWSCDK::Codepipeline::ActionProperties

This is a renamed version of the IAction.actionProperties property.



51
52
53
# File 'code_pipeline_actions/cloud_formation_create_update_stack_action.rb', line 51

def provided_action_properties()
  jsii_get_property("providedActionProperties")
end

#variable_expression(variable_name) ⇒ String

Parameters:

  • variable_name (String)

Returns:

  • (String)


104
105
106
107
# File 'code_pipeline_actions/cloud_formation_create_update_stack_action.rb', line 104

def variable_expression(variable_name)
  Jsii::Type.check_type(variable_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "variableName")
  jsii_call_method("variableExpression", [variable_name])
end