Class: AWSCDK::CodePipelineActions::EC2DeployActionProps

Inherits:
AWSCDK::Codepipeline::CommonAWSActionProps
  • Object
show all
Defined in:
code_pipeline_actions/ec2_deploy_action_props.rb

Overview

Construction properties of Ec2DeployAction.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action_name:, run_order: nil, variables_namespace: nil, role: nil, deploy_specifications:, input:, instance_tag_key:, instance_type:, instance_tag_value: nil, max_batch: nil, max_error: nil, target_groups: nil) ⇒ EC2DeployActionProps

Returns a new instance of EC2DeployActionProps.

Parameters:

  • action_name (String)

    The physical, human-readable name of the Action.

  • run_order (Numeric, nil) (defaults to: nil)

    The runOrder property for this Action.

  • variables_namespace (String, nil) (defaults to: nil)

    The name of the namespace to use for variables emitted by this action.

  • role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    The Role in which context's this Action will be executing in.

  • deploy_specifications (AWSCDK::CodePipelineActions::EC2DeploySpecifications)

    The deploy specifications.

  • input (AWSCDK::Codepipeline::Artifact)

    The input artifact to deploy to EC2 instances.

  • instance_tag_key (String)

    The tag key of the instances that you created in Amazon EC2.

  • instance_type (AWSCDK::CodePipelineActions::EC2InstanceType)

    The type of instances or SSM nodes created in Amazon EC2.

  • instance_tag_value (String, nil) (defaults to: nil)

    The tag value of the instances that you created in Amazon EC2.

  • max_batch (AWSCDK::CodePipelineActions::EC2MaxInstances, nil) (defaults to: nil)

    The number or percentage of instances that can deploy in parallel.

  • max_error (AWSCDK::CodePipelineActions::EC2MaxInstances, nil) (defaults to: nil)

    Stop the task after the task fails on the specified number or percentage of instances.

  • target_groups (Array<AWSCDK::ElasticLoadBalancingv2::ITargetGroup>, nil) (defaults to: nil)

    The list of target groups for deployment. You must have already created the target groups.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'code_pipeline_actions/ec2_deploy_action_props.rb', line 19

def initialize(action_name:, run_order: nil, variables_namespace: nil, role: nil, deploy_specifications:, input:, instance_tag_key:, instance_type:, instance_tag_value: nil, max_batch: nil, max_error: nil, target_groups: nil)
  @action_name = action_name
  Jsii::Type.check_type(@action_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "actionName")
  @run_order = run_order
  Jsii::Type.check_type(@run_order, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "runOrder") unless @run_order.nil?
  @variables_namespace = variables_namespace
  Jsii::Type.check_type(@variables_namespace, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "variablesNamespace") unless @variables_namespace.nil?
  @role = role
  Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil?
  @deploy_specifications = deploy_specifications
  Jsii::Type.check_type(@deploy_specifications, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lX2FjdGlvbnMuRWMyRGVwbG95U3BlY2lmaWNhdGlvbnMifQ==")), "deploySpecifications")
  @input = input
  Jsii::Type.check_type(@input, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lLkFydGlmYWN0In0=")), "input")
  @instance_tag_key = instance_tag_key
  Jsii::Type.check_type(@instance_tag_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "instanceTagKey")
  @instance_type = instance_type
  Jsii::Type.check_type(@instance_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lX2FjdGlvbnMuRWMySW5zdGFuY2VUeXBlIn0=")), "instanceType")
  @instance_tag_value = instance_tag_value
  Jsii::Type.check_type(@instance_tag_value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "instanceTagValue") unless @instance_tag_value.nil?
  @max_batch = max_batch
  Jsii::Type.check_type(@max_batch, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lX2FjdGlvbnMuRWMyTWF4SW5zdGFuY2VzIn0=")), "maxBatch") unless @max_batch.nil?
  @max_error = max_error
  Jsii::Type.check_type(@max_error, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lX2FjdGlvbnMuRWMyTWF4SW5zdGFuY2VzIn0=")), "maxError") unless @max_error.nil?
  @target_groups = target_groups
  Jsii::Type.check_type(@target_groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZ3YyLklUYXJnZXRHcm91cCJ9LCJraW5kIjoiYXJyYXkifX0=")), "targetGroups") unless @target_groups.nil?
end

Instance Attribute Details

#action_nameString (readonly)

The physical, human-readable name of the Action.

Note that Action names must be unique within a single Stage.

Returns:

  • (String)


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

def action_name
  @action_name
end

#deploy_specificationsAWSCDK::CodePipelineActions::EC2DeploySpecifications (readonly)

The deploy specifications.



79
80
81
# File 'code_pipeline_actions/ec2_deploy_action_props.rb', line 79

def deploy_specifications
  @deploy_specifications
end

#inputAWSCDK::Codepipeline::Artifact (readonly)

The input artifact to deploy to EC2 instances.



83
84
85
# File 'code_pipeline_actions/ec2_deploy_action_props.rb', line 83

def input
  @input
end

#instance_tag_keyString (readonly)

The tag key of the instances that you created in Amazon EC2.

Returns:

  • (String)


87
88
89
# File 'code_pipeline_actions/ec2_deploy_action_props.rb', line 87

def instance_tag_key
  @instance_tag_key
end

#instance_tag_valueString? (readonly)

Note:

Default: - all instances with instanceTagKey will be matched

The tag value of the instances that you created in Amazon EC2.

Returns:

  • (String, nil)


98
99
100
# File 'code_pipeline_actions/ec2_deploy_action_props.rb', line 98

def instance_tag_value
  @instance_tag_value
end

#instance_typeAWSCDK::CodePipelineActions::EC2InstanceType (readonly)

The type of instances or SSM nodes created in Amazon EC2.

You must have already created, tagged, and installed the SSM agent on all instances.



93
94
95
# File 'code_pipeline_actions/ec2_deploy_action_props.rb', line 93

def instance_type
  @instance_type
end

#max_batchAWSCDK::CodePipelineActions::EC2MaxInstances? (readonly)

Note:

Default: - No configuration

The number or percentage of instances that can deploy in parallel.



103
104
105
# File 'code_pipeline_actions/ec2_deploy_action_props.rb', line 103

def max_batch
  @max_batch
end

#max_errorAWSCDK::CodePipelineActions::EC2MaxInstances? (readonly)

Note:

Default: - No configuration

Stop the task after the task fails on the specified number or percentage of instances.



108
109
110
# File 'code_pipeline_actions/ec2_deploy_action_props.rb', line 108

def max_error
  @max_error
end

#roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: a new Role will be generated

The Role in which context's this Action will be executing in.

The Pipeline's Role will assume this Role (the required permissions for that will be granted automatically) right before executing this Action. This Action will be passed into your IAction.bind method in the ActionBindOptions.role property.

Returns:



75
76
77
# File 'code_pipeline_actions/ec2_deploy_action_props.rb', line 75

def role
  @role
end

#run_orderNumeric? (readonly)

Note:

Default: 1

The runOrder property for this Action.

RunOrder determines the relative order in which multiple Actions in the same Stage execute.



59
60
61
# File 'code_pipeline_actions/ec2_deploy_action_props.rb', line 59

def run_order
  @run_order
end

#target_groupsArray<AWSCDK::ElasticLoadBalancingv2::ITargetGroup>? (readonly)

Note:

Default: - No target groups

The list of target groups for deployment. You must have already created the target groups.

Target groups provide a set of instances to process specific requests. If the target group is specified, instances will be removed from the target group before deployment and added back to the target group after deployment.



116
117
118
# File 'code_pipeline_actions/ec2_deploy_action_props.rb', line 116

def target_groups
  @target_groups
end

#variables_namespaceString? (readonly)

Note:

Default: - a name will be generated, based on the stage and action names, if any of the action's variables were referenced - otherwise, no namespace will be set

The name of the namespace to use for variables emitted by this action.

Returns:

  • (String, nil)


64
65
66
# File 'code_pipeline_actions/ec2_deploy_action_props.rb', line 64

def variables_namespace
  @variables_namespace
end

Class Method Details

.jsii_propertiesObject



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'code_pipeline_actions/ec2_deploy_action_props.rb', line 118

def self.jsii_properties
  {
    :action_name => "actionName",
    :run_order => "runOrder",
    :variables_namespace => "variablesNamespace",
    :role => "role",
    :deploy_specifications => "deploySpecifications",
    :input => "input",
    :instance_tag_key => "instanceTagKey",
    :instance_type => "instanceType",
    :instance_tag_value => "instanceTagValue",
    :max_batch => "maxBatch",
    :max_error => "maxError",
    :target_groups => "targetGroups",
  }
end

Instance Method Details

#to_jsiiObject



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'code_pipeline_actions/ec2_deploy_action_props.rb', line 135

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "actionName" => @action_name,
    "runOrder" => @run_order,
    "variablesNamespace" => @variables_namespace,
    "role" => @role,
    "deploySpecifications" => @deploy_specifications,
    "input" => @input,
    "instanceTagKey" => @instance_tag_key,
    "instanceType" => @instance_type,
    "instanceTagValue" => @instance_tag_value,
    "maxBatch" => @max_batch,
    "maxError" => @max_error,
    "targetGroups" => @target_groups,
  })
  result.compact
end