Class: AWSCDK::ECSPatterns::NetworkLoadBalancedTaskImageProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ECSPatterns::NetworkLoadBalancedTaskImageProps
- Defined in:
- ecs_patterns/network_load_balanced_task_image_props.rb
Overview
Options for configuring a new container.
Instance Attribute Summary collapse
-
#container_name ⇒ String?
readonly
The container name value to be specified in the task definition.
-
#container_ports ⇒ Array<Numeric>?
readonly
A list of port numbers on the container that is bound to the user-specified or automatically assigned host port.
-
#docker_labels ⇒ Hash{String => String}?
readonly
A key/value map of labels to add to the container.
-
#enable_logging ⇒ Boolean?
readonly
Flag to indicate whether to enable logging.
-
#environment ⇒ Hash{String => String}?
readonly
The environment variables to pass to the container.
-
#execution_role ⇒ AWSCDK::IAM::IRole?
readonly
The name of the task execution IAM role that grants the Amazon ECS container agent permission to call AWS APIs on your behalf.
-
#family ⇒ String?
readonly
The name of a family that this task definition is registered to.
-
#image ⇒ AWSCDK::ECS::ContainerImage
readonly
The image used to start a container.
-
#log_driver ⇒ AWSCDK::ECS::LogDriver?
readonly
The log driver to use.
-
#secrets ⇒ Hash{String => AWSCDK::ECS::Secret}?
readonly
The secrets to expose to the container as an environment variable.
-
#task_role ⇒ AWSCDK::IAM::IRole?
readonly
The name of the task IAM role that grants containers in the task permission to call AWS APIs on your behalf.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(image:, container_name: nil, container_ports: nil, docker_labels: nil, enable_logging: nil, environment: nil, execution_role: nil, family: nil, log_driver: nil, secrets: nil, task_role: nil) ⇒ NetworkLoadBalancedTaskImageProps
constructor
A new instance of NetworkLoadBalancedTaskImageProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(image:, container_name: nil, container_ports: nil, docker_labels: nil, enable_logging: nil, environment: nil, execution_role: nil, family: nil, log_driver: nil, secrets: nil, task_role: nil) ⇒ NetworkLoadBalancedTaskImageProps
Returns a new instance of NetworkLoadBalancedTaskImageProps.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'ecs_patterns/network_load_balanced_task_image_props.rb', line 18 def initialize(image:, container_name: nil, container_ports: nil, docker_labels: nil, enable_logging: nil, environment: nil, execution_role: nil, family: nil, log_driver: nil, secrets: nil, task_role: nil) @image = image Jsii::Type.check_type(@image, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNvbnRhaW5lckltYWdlIn0=")), "image") @container_name = container_name Jsii::Type.check_type(@container_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "containerName") unless @container_name.nil? @container_ports = container_ports Jsii::Type.check_type(@container_ports, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6Im51bWJlciJ9LCJraW5kIjoiYXJyYXkifX0=")), "containerPorts") unless @container_ports.nil? @docker_labels = docker_labels Jsii::Type.check_type(@docker_labels, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "dockerLabels") unless @docker_labels.nil? @enable_logging = enable_logging Jsii::Type.check_type(@enable_logging, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enableLogging") unless @enable_logging.nil? @environment = environment Jsii::Type.check_type(@environment, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "environment") unless @environment.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? @log_driver = log_driver Jsii::Type.check_type(@log_driver, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkxvZ0RyaXZlciJ9")), "logDriver") unless @log_driver.nil? @secrets = secrets Jsii::Type.check_type(@secrets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuU2VjcmV0In0sImtpbmQiOiJtYXAifX0=")), "secrets") unless @secrets.nil? @task_role = task_role Jsii::Type.check_type(@task_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "taskRole") unless @task_role.nil? end |
Instance Attribute Details
#container_name ⇒ String? (readonly)
Default: - none
The container name value to be specified in the task definition.
54 55 56 |
# File 'ecs_patterns/network_load_balanced_task_image_props.rb', line 54 def container_name @container_name end |
#container_ports ⇒ Array<Numeric>? (readonly)
Default: - [80]
A list of port numbers on the container that is bound to the user-specified or automatically assigned host port.
If you are using containers in a task with the awsvpc or host network mode, exposed ports should be specified using containerPort. If you are using containers in a task with the bridge network mode and you specify a container port and not a host port, your container automatically receives a host port in the ephemeral port range.
Port mappings that are automatically assigned in this way do not count toward the 100 reserved ports limit of a container instance.
For more information, see hostPort.
68 69 70 |
# File 'ecs_patterns/network_load_balanced_task_image_props.rb', line 68 def container_ports @container_ports end |
#docker_labels ⇒ Hash{String => String}? (readonly)
Default: - No labels.
A key/value map of labels to add to the container.
73 74 75 |
# File 'ecs_patterns/network_load_balanced_task_image_props.rb', line 73 def docker_labels @docker_labels end |
#enable_logging ⇒ Boolean? (readonly)
Default: true
Flag to indicate whether to enable logging.
78 79 80 |
# File 'ecs_patterns/network_load_balanced_task_image_props.rb', line 78 def enable_logging @enable_logging end |
#environment ⇒ Hash{String => String}? (readonly)
Default: - No environment variables.
The environment variables to pass to the container.
83 84 85 |
# File 'ecs_patterns/network_load_balanced_task_image_props.rb', line 83 def environment @environment end |
#execution_role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - No value
The name of the task execution IAM role that grants the Amazon ECS container agent permission to call AWS APIs on your behalf.
88 89 90 |
# File 'ecs_patterns/network_load_balanced_task_image_props.rb', line 88 def execution_role @execution_role end |
#family ⇒ String? (readonly)
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.
95 96 97 |
# File 'ecs_patterns/network_load_balanced_task_image_props.rb', line 95 def family @family end |
#image ⇒ AWSCDK::ECS::ContainerImage (readonly)
Default: - none
The image used to start a container.
Image or taskDefinition must be specified, but not both.
49 50 51 |
# File 'ecs_patterns/network_load_balanced_task_image_props.rb', line 49 def image @image end |
#log_driver ⇒ AWSCDK::ECS::LogDriver? (readonly)
Default: - AwsLogDriver if enableLogging is true
The log driver to use.
100 101 102 |
# File 'ecs_patterns/network_load_balanced_task_image_props.rb', line 100 def log_driver @log_driver end |
#secrets ⇒ Hash{String => AWSCDK::ECS::Secret}? (readonly)
Default: - No secret environment variables.
The secrets to expose to the container as an environment variable.
105 106 107 |
# File 'ecs_patterns/network_load_balanced_task_image_props.rb', line 105 def secrets @secrets end |
#task_role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - A task role is automatically created for you.
The name of the task IAM role that grants containers in the task permission to call AWS APIs on your behalf.
110 111 112 |
# File 'ecs_patterns/network_load_balanced_task_image_props.rb', line 110 def task_role @task_role end |
Class Method Details
.jsii_properties ⇒ Object
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'ecs_patterns/network_load_balanced_task_image_props.rb', line 112 def self.jsii_properties { :image => "image", :container_name => "containerName", :container_ports => "containerPorts", :docker_labels => "dockerLabels", :enable_logging => "enableLogging", :environment => "environment", :execution_role => "executionRole", :family => "family", :log_driver => "logDriver", :secrets => "secrets", :task_role => "taskRole", } end |
Instance Method Details
#to_jsii ⇒ Object
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'ecs_patterns/network_load_balanced_task_image_props.rb', line 128 def to_jsii result = {} result.merge!({ "image" => @image, "containerName" => @container_name, "containerPorts" => @container_ports, "dockerLabels" => @docker_labels, "enableLogging" => @enable_logging, "environment" => @environment, "executionRole" => @execution_role, "family" => @family, "logDriver" => @log_driver, "secrets" => @secrets, "taskRole" => @task_role, }) result.compact end |