Class: AWSCDK::ECS::CommonTaskDefinitionProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ecs/common_task_definition_props.rb

Overview

The common properties for all task definitions.

For more information, see Task Definition Parameters.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enable_fault_injection: nil, execution_role: nil, family: nil, proxy_configuration: nil, task_role: nil, volumes: nil) ⇒ CommonTaskDefinitionProps

Returns a new instance of CommonTaskDefinitionProps.

Parameters:

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

    Enables fault injection and allows for fault injection requests to be accepted from the task's containers.

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

    The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf.

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

    The name of a family that this task definition is registered to.

  • proxy_configuration (AWSCDK::ECS::ProxyConfiguration, nil) (defaults to: nil)

    The configuration details for the App Mesh proxy.

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

    The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.

  • volumes (Array<AWSCDK::ECS::Volume>, nil) (defaults to: nil)

    The list of volume definitions for the task.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'ecs/common_task_definition_props.rb', line 16

def initialize(enable_fault_injection: nil, execution_role: nil, family: nil, proxy_configuration: nil, task_role: nil, volumes: nil)
  @enable_fault_injection = enable_fault_injection
  Jsii::Type.check_type(@enable_fault_injection, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enableFaultInjection") unless @enable_fault_injection.nil?
  @execution_role = execution_role
  Jsii::Type.check_type(@execution_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "executionRole") unless @execution_role.nil?
  @family = family
  Jsii::Type.check_type(@family, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "family") unless @family.nil?
  @proxy_configuration = proxy_configuration
  Jsii::Type.check_type(@proxy_configuration, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlByb3h5Q29uZmlndXJhdGlvbiJ9")), "proxyConfiguration") unless @proxy_configuration.nil?
  @task_role = task_role
  Jsii::Type.check_type(@task_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "taskRole") unless @task_role.nil?
  @volumes = volumes.is_a?(Array) ? volumes.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::ECS::Volume.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : volumes
  Jsii::Type.check_type(@volumes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuVm9sdW1lIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "volumes") unless @volumes.nil?
end

Instance Attribute Details

#enable_fault_injectionBoolean? (readonly)

Note:

Default: undefined - ECS default setting is false

Enables fault injection and allows for fault injection requests to be accepted from the task's containers.

Fault injection only works with tasks using the NetworkMode.AWS_VPC or NetworkMode.HOST network modes.

Returns:

  • (Boolean, nil)


37
38
39
# File 'ecs/common_task_definition_props.rb', line 37

def enable_fault_injection
  @enable_fault_injection
end

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

Note:

Default: - An execution role will be automatically created if you use ECR images in your task definition.

The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf.

The role will be used to retrieve container images from ECR and create CloudWatch log groups.

Returns:



44
45
46
# File 'ecs/common_task_definition_props.rb', line 44

def execution_role
  @execution_role
end

#familyString? (readonly)

Note:

Default: - Automatically generated name.

The name of a family that this task definition is registered to.

A family groups multiple versions of a task definition.

Returns:

  • (String, nil)


51
52
53
# File 'ecs/common_task_definition_props.rb', line 51

def family
  @family
end

#proxy_configurationAWSCDK::ECS::ProxyConfiguration? (readonly)

Note:

Default: - No proxy configuration.

The configuration details for the App Mesh proxy.



56
57
58
# File 'ecs/common_task_definition_props.rb', line 56

def proxy_configuration
  @proxy_configuration
end

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

Note:

Default: - A task role is automatically created for you.

The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.

Returns:



61
62
63
# File 'ecs/common_task_definition_props.rb', line 61

def task_role
  @task_role
end

#volumesArray<AWSCDK::ECS::Volume>? (readonly)

Note:

Default: - No volumes are passed to the Docker daemon on a container instance.

The list of volume definitions for the task.

For more information, see Task Definition Parameter Volumes.

Returns:



69
70
71
# File 'ecs/common_task_definition_props.rb', line 69

def volumes
  @volumes
end

Class Method Details

.jsii_propertiesObject



71
72
73
74
75
76
77
78
79
80
# File 'ecs/common_task_definition_props.rb', line 71

def self.jsii_properties
  {
    :enable_fault_injection => "enableFaultInjection",
    :execution_role => "executionRole",
    :family => "family",
    :proxy_configuration => "proxyConfiguration",
    :task_role => "taskRole",
    :volumes => "volumes",
  }
end

Instance Method Details

#to_jsiiObject



82
83
84
85
86
87
88
89
90
91
92
93
# File 'ecs/common_task_definition_props.rb', line 82

def to_jsii
  result = {}
  result.merge!({
    "enableFaultInjection" => @enable_fault_injection,
    "executionRole" => @execution_role,
    "family" => @family,
    "proxyConfiguration" => @proxy_configuration,
    "taskRole" => @task_role,
    "volumes" => @volumes,
  })
  result.compact
end