Class: AWSCDK::CodePipelineActions::CodeDeployECSDeployActionProps

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

Overview

Construction properties of the CodeDeployEcsDeployAction CodeDeploy ECS deploy CodePipeline Action.

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, deployment_group:, app_spec_template_file: nil, app_spec_template_input: nil, container_image_inputs: nil, task_definition_template_file: nil, task_definition_template_input: nil) ⇒ CodeDeployECSDeployActionProps

Returns a new instance of CodeDeployECSDeployActionProps.

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.

  • deployment_group (AWSCDK::CodeDeploy::IECSDeploymentGroup)

    The CodeDeploy ECS Deployment Group to deploy to.

  • app_spec_template_file (AWSCDK::Codepipeline::ArtifactPath, nil) (defaults to: nil)

    The name of the CodeDeploy AppSpec file.

  • app_spec_template_input (AWSCDK::Codepipeline::Artifact, nil) (defaults to: nil)

    The artifact containing the CodeDeploy AppSpec file.

  • container_image_inputs (Array<AWSCDK::CodePipelineActions::CodeDeployECSContainerImageInput>, nil) (defaults to: nil)

    Configuration for dynamically updated images in the task definition.

  • task_definition_template_file (AWSCDK::Codepipeline::ArtifactPath, nil) (defaults to: nil)

    The name of the ECS task definition template file.

  • task_definition_template_input (AWSCDK::Codepipeline::Artifact, nil) (defaults to: nil)

    The artifact containing the ECS task definition template file.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'code_pipeline_actions/code_deploy_ecs_deploy_action_props.rb', line 17

def initialize(action_name:, run_order: nil, variables_namespace: nil, role: nil, deployment_group:, app_spec_template_file: nil, app_spec_template_input: nil, container_image_inputs: nil, task_definition_template_file: nil, task_definition_template_input: 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?
  @deployment_group = deployment_group
  Jsii::Type.check_type(@deployment_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWRlcGxveS5JRWNzRGVwbG95bWVudEdyb3VwIn0=")), "deploymentGroup")
  @app_spec_template_file = app_spec_template_file
  Jsii::Type.check_type(@app_spec_template_file, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lLkFydGlmYWN0UGF0aCJ9")), "appSpecTemplateFile") unless @app_spec_template_file.nil?
  @app_spec_template_input = app_spec_template_input
  Jsii::Type.check_type(@app_spec_template_input, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lLkFydGlmYWN0In0=")), "appSpecTemplateInput") unless @app_spec_template_input.nil?
  @container_image_inputs = container_image_inputs.is_a?(Array) ? container_image_inputs.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CodePipelineActions::CodeDeployECSContainerImageInput.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : container_image_inputs
  Jsii::Type.check_type(@container_image_inputs, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2RlcGlwZWxpbmVfYWN0aW9ucy5Db2RlRGVwbG95RWNzQ29udGFpbmVySW1hZ2VJbnB1dCJ9LCJraW5kIjoiYXJyYXkifX0=")), "containerImageInputs") unless @container_image_inputs.nil?
  @task_definition_template_file = task_definition_template_file
  Jsii::Type.check_type(@task_definition_template_file, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lLkFydGlmYWN0UGF0aCJ9")), "taskDefinitionTemplateFile") unless @task_definition_template_file.nil?
  @task_definition_template_input = task_definition_template_input
  Jsii::Type.check_type(@task_definition_template_input, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lLkFydGlmYWN0In0=")), "taskDefinitionTemplateInput") unless @task_definition_template_input.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)


45
46
47
# File 'code_pipeline_actions/code_deploy_ecs_deploy_action_props.rb', line 45

def action_name
  @action_name
end

#app_spec_template_fileAWSCDK::Codepipeline::ArtifactPath? (readonly)

Note:

Default: - one of this property, or appSpecTemplateInput, is required

The name of the CodeDeploy AppSpec file.

During deployment, a new task definition will be registered with ECS, and the new task definition ID will be inserted into the CodeDeploy AppSpec file. The AppSpec file contents will be provided to CodeDeploy for the deployment.

Use this property if you want to use a different name for this file than the default 'appspec.yaml'. If you use this property, you don't need to specify the app_spec_template_input property.



86
87
88
# File 'code_pipeline_actions/code_deploy_ecs_deploy_action_props.rb', line 86

def app_spec_template_file
  @app_spec_template_file
end

#app_spec_template_inputAWSCDK::Codepipeline::Artifact? (readonly)

Note:

Default: - one of this property, or appSpecTemplateFile, is required

The artifact containing the CodeDeploy AppSpec file.

During deployment, a new task definition will be registered with ECS, and the new task definition ID will be inserted into the CodeDeploy AppSpec file. The AppSpec file contents will be provided to CodeDeploy for the deployment.

If you use this property, it's assumed the file is called 'appspec.yaml'. If your AppSpec file uses a different filename, leave this property empty, and use the app_spec_template_file property instead.



100
101
102
# File 'code_pipeline_actions/code_deploy_ecs_deploy_action_props.rb', line 100

def app_spec_template_input
  @app_spec_template_input
end

#container_image_inputsArray<AWSCDK::CodePipelineActions::CodeDeployECSContainerImageInput>? (readonly)

Configuration for dynamically updated images in the task definition.

Provide pairs of an image details input artifact and a placeholder string that will be used to dynamically update the ECS task definition template file prior to deployment. A maximum of 4 images can be given.



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

def container_image_inputs
  @container_image_inputs
end

#deployment_groupAWSCDK::CodeDeploy::IECSDeploymentGroup (readonly)

The CodeDeploy ECS Deployment Group to deploy to.



73
74
75
# File 'code_pipeline_actions/code_deploy_ecs_deploy_action_props.rb', line 73

def deployment_group
  @deployment_group
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:



69
70
71
# File 'code_pipeline_actions/code_deploy_ecs_deploy_action_props.rb', line 69

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.



53
54
55
# File 'code_pipeline_actions/code_deploy_ecs_deploy_action_props.rb', line 53

def run_order
  @run_order
end

#task_definition_template_fileAWSCDK::Codepipeline::ArtifactPath? (readonly)

Note:

Default: - one of this property, or taskDefinitionTemplateInput, is required

The name of the ECS task definition template file.

During deployment, the task definition template file contents will be registered with ECS.

Use this property if you want to use a different name for this file than the default 'taskdef.json'. If you use this property, you don't need to specify the task_definition_template_input property.



119
120
121
# File 'code_pipeline_actions/code_deploy_ecs_deploy_action_props.rb', line 119

def task_definition_template_file
  @task_definition_template_file
end

#task_definition_template_inputAWSCDK::Codepipeline::Artifact? (readonly)

Note:

Default: - one of this property, or taskDefinitionTemplateFile, is required

The artifact containing the ECS task definition template file.

During deployment, the task definition template file contents will be registered with ECS.

If you use this property, it's assumed the file is called 'taskdef.json'. If your task definition template uses a different filename, leave this property empty, and use the task_definition_template_file property instead.



131
132
133
# File 'code_pipeline_actions/code_deploy_ecs_deploy_action_props.rb', line 131

def task_definition_template_input
  @task_definition_template_input
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)


58
59
60
# File 'code_pipeline_actions/code_deploy_ecs_deploy_action_props.rb', line 58

def variables_namespace
  @variables_namespace
end

Class Method Details

.jsii_propertiesObject



133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'code_pipeline_actions/code_deploy_ecs_deploy_action_props.rb', line 133

def self.jsii_properties
  {
    :action_name => "actionName",
    :run_order => "runOrder",
    :variables_namespace => "variablesNamespace",
    :role => "role",
    :deployment_group => "deploymentGroup",
    :app_spec_template_file => "appSpecTemplateFile",
    :app_spec_template_input => "appSpecTemplateInput",
    :container_image_inputs => "containerImageInputs",
    :task_definition_template_file => "taskDefinitionTemplateFile",
    :task_definition_template_input => "taskDefinitionTemplateInput",
  }
end

Instance Method Details

#to_jsiiObject



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'code_pipeline_actions/code_deploy_ecs_deploy_action_props.rb', line 148

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "actionName" => @action_name,
    "runOrder" => @run_order,
    "variablesNamespace" => @variables_namespace,
    "role" => @role,
    "deploymentGroup" => @deployment_group,
    "appSpecTemplateFile" => @app_spec_template_file,
    "appSpecTemplateInput" => @app_spec_template_input,
    "containerImageInputs" => @container_image_inputs,
    "taskDefinitionTemplateFile" => @task_definition_template_file,
    "taskDefinitionTemplateInput" => @task_definition_template_input,
  })
  result.compact
end