Class: AWSCDK::CodePipelineActions::CodeDeployECSContainerImageInput

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
code_pipeline_actions/code_deploy_ecs_container_image_input.rb

Overview

Configuration for replacing a placeholder string in the ECS task definition template file with an image URI.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input:, task_definition_placeholder: nil) ⇒ CodeDeployECSContainerImageInput

Returns a new instance of CodeDeployECSContainerImageInput.

Parameters:

  • input (AWSCDK::Codepipeline::Artifact)

    The artifact that contains an imageDetails.json file with the image URI.

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

    The placeholder string in the ECS task definition template file that will be replaced with the image URI.



9
10
11
12
13
14
# File 'code_pipeline_actions/code_deploy_ecs_container_image_input.rb', line 9

def initialize(input:, task_definition_placeholder: nil)
  @input = input
  Jsii::Type.check_type(@input, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lLkFydGlmYWN0In0=")), "input")
  @task_definition_placeholder = task_definition_placeholder
  Jsii::Type.check_type(@task_definition_placeholder, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "taskDefinitionPlaceholder") unless @task_definition_placeholder.nil?
end

Instance Attribute Details

#inputAWSCDK::Codepipeline::Artifact (readonly)

The artifact that contains an imageDetails.json file with the image URI.

The artifact's imageDetails.json file must be a JSON file containing an ImageURI property. For example: { "ImageURI": "ACCOUNTID.dkr.ecr.us-west-2.amazonaws.com/dk-image-repo@sha256:example3" }



23
24
25
# File 'code_pipeline_actions/code_deploy_ecs_container_image_input.rb', line 23

def input
  @input
end

#task_definition_placeholderString? (readonly)

Note:

Default: IMAGE

The placeholder string in the ECS task definition template file that will be replaced with the image URI.

The placeholder string must be surrounded by angle brackets in the template file. For example, if the task definition template file contains a placeholder like "image": "<PLACEHOLDER>", then the task_definition_placeholder value should be PLACEHOLDER.

Returns:

  • (String, nil)


33
34
35
# File 'code_pipeline_actions/code_deploy_ecs_container_image_input.rb', line 33

def task_definition_placeholder
  @task_definition_placeholder
end

Class Method Details

.jsii_propertiesObject



35
36
37
38
39
40
# File 'code_pipeline_actions/code_deploy_ecs_container_image_input.rb', line 35

def self.jsii_properties
  {
    :input => "input",
    :task_definition_placeholder => "taskDefinitionPlaceholder",
  }
end

Instance Method Details

#to_jsiiObject



42
43
44
45
46
47
48
49
# File 'code_pipeline_actions/code_deploy_ecs_container_image_input.rb', line 42

def to_jsii
  result = {}
  result.merge!({
    "input" => @input,
    "taskDefinitionPlaceholder" => @task_definition_placeholder,
  })
  result.compact
end