Class: AWSCDK::StepFunctionsTasks::DockerImage

Inherits:
Jsii::Object
  • Object
show all
Defined in:
step_functions_tasks/docker_image.rb

Overview

Creates IDockerImage instances.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDockerImage

Returns a new instance of DockerImage.



8
9
10
# File 'step_functions_tasks/docker_image.rb', line 8

def initialize
  Jsii::Object.instance_method(:initialize).bind(self).call
end

Class Method Details

.from_asset(scope, id, props) ⇒ AWSCDK::StepFunctionsTasks::DockerImage

Reference a Docker image that is provided as an Asset in the current app.

Parameters:

  • scope (Constructs::Construct)

    the scope in which to create the Asset.

  • id (String)

    the ID for the asset in the construct tree.

  • props (AWSCDK::ECRAssets::DockerImageAssetProps)

    the configuration props of the asset.

Returns:

  • (AWSCDK::StepFunctionsTasks::DockerImage)


24
25
26
27
28
29
30
# File 'step_functions_tasks/docker_image.rb', line 24

def self.from_asset(scope, id, props)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  props = props.is_a?(Hash) ? ::AWSCDK::ECRAssets::DockerImageAssetProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNyX2Fzc2V0cy5Eb2NrZXJJbWFnZUFzc2V0UHJvcHMifQ==")), "props")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions_tasks.DockerImage", "fromAsset", [scope, id, props])
end

.from_ecr_repository(repository, tag_or_digest = nil) ⇒ AWSCDK::StepFunctionsTasks::DockerImage

Reference a Docker image stored in an ECR repository.

Parameters:

  • repository (AWSCDK::ECR::IRepository)

    the ECR repository where the image is hosted.

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

    an optional tag or digest (digests must start with sha256:).

Returns:

  • (AWSCDK::StepFunctionsTasks::DockerImage)


37
38
39
40
41
# File 'step_functions_tasks/docker_image.rb', line 37

def self.from_ecr_repository(repository, tag_or_digest = nil)
  Jsii::Type.check_type(repository, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNyLklSZXBvc2l0b3J5In0=")), "repository")
  Jsii::Type.check_type(tag_or_digest, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "tagOrDigest") unless tag_or_digest.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions_tasks.DockerImage", "fromEcrRepository", [repository, tag_or_digest])
end

.from_json_expression(expression, allow_any_ecr_image_pull = nil) ⇒ AWSCDK::StepFunctionsTasks::DockerImage

Reference a Docker image which URI is obtained from the task's input.

Parameters:

  • expression (String)

    the JSONata or JSON path expression with the task input.

  • allow_any_ecr_image_pull (Boolean, nil) (defaults to: nil)

    whether ECR access should be permitted (set to false if the image will never be in ECR).

Returns:

  • (AWSCDK::StepFunctionsTasks::DockerImage)


48
49
50
51
52
# File 'step_functions_tasks/docker_image.rb', line 48

def self.from_json_expression(expression, allow_any_ecr_image_pull = nil)
  Jsii::Type.check_type(expression, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "expression")
  Jsii::Type.check_type(allow_any_ecr_image_pull, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "allowAnyEcrImagePull") unless allow_any_ecr_image_pull.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions_tasks.DockerImage", "fromJsonExpression", [expression, allow_any_ecr_image_pull])
end

.from_registry(image_uri) ⇒ AWSCDK::StepFunctionsTasks::DockerImage

Reference a Docker image by it's URI.

When referencing ECR images, prefer using in_ecr.

Parameters:

  • image_uri (String)

    the URI to the docker image.

Returns:

  • (AWSCDK::StepFunctionsTasks::DockerImage)


60
61
62
63
# File 'step_functions_tasks/docker_image.rb', line 60

def self.from_registry(image_uri)
  Jsii::Type.check_type(image_uri, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "imageUri")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_stepfunctions_tasks.DockerImage", "fromRegistry", [image_uri])
end

.jsii_overridable_methodsObject



12
13
14
15
16
# File 'step_functions_tasks/docker_image.rb', line 12

def self.jsii_overridable_methods
  {
    :bind => { kind: :method, name: "bind", is_optional: false },
  }
end

Instance Method Details

#bind(task) ⇒ AWSCDK::StepFunctionsTasks::DockerImageConfig

Called when the image is used by a SageMaker task.



69
70
71
72
# File 'step_functions_tasks/docker_image.rb', line 69

def bind(task)
  Jsii::Type.check_type(task, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9uc190YXNrcy5JU2FnZU1ha2VyVGFzayJ9")), "task")
  jsii_call_method("bind", [task])
end