Class: AWSCDK::Batch::ECSFargateContainerDefinition
- Inherits:
-
Constructs::Construct
- Object
- Constructs::Construct
- AWSCDK::Batch::ECSFargateContainerDefinition
- Includes:
- IECSContainerDefinition, IECSFargateContainerDefinition
- Defined in:
- batch/ecs_fargate_container_definition.rb
Overview
A container orchestrated by ECS that uses Fargate resources.
Class Method Summary collapse
- .jsii_overridable_methods ⇒ Object
-
.PROPERTY_INJECTION_ID ⇒ String
Uniquely identifies this class.
Instance Method Summary collapse
-
#add_volume(volume) ⇒ void
Add a Volume to this container.
-
#assign_public_ip ⇒ Boolean?
Indicates whether the job has a public IP address.
-
#command ⇒ Array<String>?
The command that's passed to the container.
-
#cpu ⇒ Numeric
The number of vCPUs reserved for the container.
-
#enable_execute_command ⇒ Boolean?
Whether to enable ecs exec for this container.
-
#environment ⇒ Hash{String => String}?
The environment variables to pass to a container.
-
#ephemeral_storage_size ⇒ AWSCDK::Size?
The size for ephemeral storage.
-
#execution_role ⇒ AWSCDK::IAM::IRole
The role used by Amazon ECS container and AWS Fargate agents to make AWS API calls on your behalf.
-
#fargate_cpu_architecture ⇒ AWSCDK::ECS::CpuArchitecture?
The vCPU architecture of Fargate Runtime.
-
#fargate_operating_system_family ⇒ AWSCDK::ECS::OperatingSystemFamily?
The operating system for the compute environment.
-
#fargate_platform_version ⇒ AWSCDK::ECS::FargatePlatformVersion?
Which version of Fargate to use when running this container.
-
#image ⇒ AWSCDK::ECS::ContainerImage
The image that this container will run.
-
#initialize(scope, id, props) ⇒ ECSFargateContainerDefinition
constructor
A new instance of ECSFargateContainerDefinition.
-
#job_role ⇒ AWSCDK::IAM::IRole?
The role that the container can assume.
-
#linux_parameters ⇒ AWSCDK::Batch::LinuxParameters?
Linux-specific modifications that are applied to the container, such as details for device mappings.
-
#log_driver_config ⇒ AWSCDK::ECS::LogDriverConfig?
The configuration of the log driver.
-
#memory ⇒ AWSCDK::Size
The memory hard limit present to the container.
-
#node ⇒ Constructs::Node
The tree node.
-
#readonly_root_filesystem ⇒ Boolean?
Gives the container readonly access to its root filesystem.
-
#secrets ⇒ Hash{String => AWSCDK::Batch::Secret}?
A map from environment variable names to the secrets for the container.
-
#to_string ⇒ String
Returns a string representation of this construct.
-
#user ⇒ String?
The user name to use inside the container.
-
#volumes ⇒ Array<AWSCDK::Batch::ECSVolume>
The volumes to mount to this container.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Constructor Details
#initialize(scope, id, props) ⇒ ECSFargateContainerDefinition
Returns a new instance of ECSFargateContainerDefinition.
13 14 15 16 17 18 19 |
# File 'batch/ecs_fargate_container_definition.rb', line 13 def initialize(scope, id, props) props = props.is_a?(Hash) ? ::AWSCDK::Batch::ECSFargateContainerDefinitionProps.new(**props.transform_keys(&:to_sym)) : 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") Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmF0Y2guRWNzRmFyZ2F0ZUNvbnRhaW5lckRlZmluaXRpb25Qcm9wcyJ9")), "props") Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'batch/ecs_fargate_container_definition.rb', line 21 def self.jsii_overridable_methods { :node => { kind: :property, name: "node", is_optional: false }, :cpu => { kind: :property, name: "cpu", is_optional: false }, :execution_role => { kind: :property, name: "executionRole", is_optional: false }, :image => { kind: :property, name: "image", is_optional: false }, :memory => { kind: :property, name: "memory", is_optional: false }, :volumes => { kind: :property, name: "volumes", is_optional: false }, :assign_public_ip => { kind: :property, name: "assignPublicIp", is_optional: true }, :command => { kind: :property, name: "command", is_optional: true }, :enable_execute_command => { kind: :property, name: "enableExecuteCommand", is_optional: true }, :environment => { kind: :property, name: "environment", is_optional: true }, :ephemeral_storage_size => { kind: :property, name: "ephemeralStorageSize", is_optional: true }, :fargate_cpu_architecture => { kind: :property, name: "fargateCpuArchitecture", is_optional: true }, :fargate_operating_system_family => { kind: :property, name: "fargateOperatingSystemFamily", is_optional: true }, :fargate_platform_version => { kind: :property, name: "fargatePlatformVersion", is_optional: true }, :job_role => { kind: :property, name: "jobRole", is_optional: true }, :linux_parameters => { kind: :property, name: "linuxParameters", is_optional: true }, :log_driver_config => { kind: :property, name: "logDriverConfig", is_optional: true }, :readonly_root_filesystem => { kind: :property, name: "readonlyRootFilesystem", is_optional: true }, :secrets => { kind: :property, name: "secrets", is_optional: true }, :user => { kind: :property, name: "user", is_optional: true }, :to_string => { kind: :method, name: "toString", is_optional: false }, :with => { kind: :method, name: "with", is_optional: false }, :add_volume => { kind: :method, name: "addVolume", is_optional: false }, } end |
.PROPERTY_INJECTION_ID ⇒ String
Uniquely identifies this class.
59 60 61 |
# File 'batch/ecs_fargate_container_definition.rb', line 59 def self.PROPERTY_INJECTION_ID() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_batch.EcsFargateContainerDefinition", "PROPERTY_INJECTION_ID") end |
Instance Method Details
#add_volume(volume) ⇒ void
This method returns an undefined value.
Add a Volume to this container.
240 241 242 243 |
# File 'batch/ecs_fargate_container_definition.rb', line 240 def add_volume(volume) Jsii::Type.check_type(volume, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmF0Y2guRWNzVm9sdW1lIn0=")), "volume") jsii_call_method("addVolume", [volume]) end |
#assign_public_ip ⇒ Boolean?
Indicates whether the job has a public IP address.
For a job that's running on Fargate resources in a private subnet to send outbound traffic to the internet (for example, to pull container images), the private subnet requires a NAT gateway be attached to route requests to the internet.
112 113 114 |
# File 'batch/ecs_fargate_container_definition.rb', line 112 def assign_public_ip() jsii_get_property("assignPublicIp") end |
#command ⇒ Array<String>?
The command that's passed to the container.
119 120 121 |
# File 'batch/ecs_fargate_container_definition.rb', line 119 def command() jsii_get_property("command") end |
#cpu ⇒ Numeric
The number of vCPUs reserved for the container.
Each vCPU is equivalent to 1,024 CPU shares. For containers running on EC2 resources, you must specify at least one vCPU.
69 70 71 |
# File 'batch/ecs_fargate_container_definition.rb', line 69 def cpu() jsii_get_property("cpu") end |
#enable_execute_command ⇒ Boolean?
Whether to enable ecs exec for this container.
126 127 128 |
# File 'batch/ecs_fargate_container_definition.rb', line 126 def enable_execute_command() jsii_get_property("enableExecuteCommand") end |
#environment ⇒ Hash{String => String}?
The environment variables to pass to a container.
Cannot start with AWS_BATCH.
We don't recommend using plaintext environment variables for sensitive information, such as credential data.
136 137 138 |
# File 'batch/ecs_fargate_container_definition.rb', line 136 def environment() jsii_get_property("environment") end |
#ephemeral_storage_size ⇒ AWSCDK::Size?
The size for ephemeral storage.
143 144 145 |
# File 'batch/ecs_fargate_container_definition.rb', line 143 def ephemeral_storage_size() jsii_get_property("ephemeralStorageSize") end |
#execution_role ⇒ AWSCDK::IAM::IRole
The role used by Amazon ECS container and AWS Fargate agents to make AWS API calls on your behalf.
76 77 78 |
# File 'batch/ecs_fargate_container_definition.rb', line 76 def execution_role() jsii_get_property("executionRole") end |
#fargate_cpu_architecture ⇒ AWSCDK::ECS::CpuArchitecture?
The vCPU architecture of Fargate Runtime.
150 151 152 |
# File 'batch/ecs_fargate_container_definition.rb', line 150 def fargate_cpu_architecture() jsii_get_property("fargateCpuArchitecture") end |
#fargate_operating_system_family ⇒ AWSCDK::ECS::OperatingSystemFamily?
The operating system for the compute environment.
157 158 159 |
# File 'batch/ecs_fargate_container_definition.rb', line 157 def () jsii_get_property("fargateOperatingSystemFamily") end |
#fargate_platform_version ⇒ AWSCDK::ECS::FargatePlatformVersion?
Which version of Fargate to use when running this container.
164 165 166 |
# File 'batch/ecs_fargate_container_definition.rb', line 164 def fargate_platform_version() jsii_get_property("fargatePlatformVersion") end |
#image ⇒ AWSCDK::ECS::ContainerImage
The image that this container will run.
83 84 85 |
# File 'batch/ecs_fargate_container_definition.rb', line 83 def image() jsii_get_property("image") end |
#job_role ⇒ AWSCDK::IAM::IRole?
The role that the container can assume.
171 172 173 |
# File 'batch/ecs_fargate_container_definition.rb', line 171 def job_role() jsii_get_property("jobRole") end |
#linux_parameters ⇒ AWSCDK::Batch::LinuxParameters?
Linux-specific modifications that are applied to the container, such as details for device mappings.
178 179 180 |
# File 'batch/ecs_fargate_container_definition.rb', line 178 def linux_parameters() jsii_get_property("linuxParameters") end |
#log_driver_config ⇒ AWSCDK::ECS::LogDriverConfig?
The configuration of the log driver.
185 186 187 |
# File 'batch/ecs_fargate_container_definition.rb', line 185 def log_driver_config() jsii_get_property("logDriverConfig") end |
#memory ⇒ AWSCDK::Size
The memory hard limit present to the container.
If your container attempts to exceed the memory specified, the container is terminated. You must specify at least 4 MiB of memory for a job.
93 94 95 |
# File 'batch/ecs_fargate_container_definition.rb', line 93 def memory() jsii_get_property("memory") end |
#node ⇒ Constructs::Node
The tree node.
52 53 54 |
# File 'batch/ecs_fargate_container_definition.rb', line 52 def node() jsii_get_property("node") end |
#readonly_root_filesystem ⇒ Boolean?
Gives the container readonly access to its root filesystem.
192 193 194 |
# File 'batch/ecs_fargate_container_definition.rb', line 192 def readonly_root_filesystem() jsii_get_property("readonlyRootFilesystem") end |
#secrets ⇒ Hash{String => AWSCDK::Batch::Secret}?
A map from environment variable names to the secrets for the container.
Allows your job definitions to reference the secret by the environment variable name defined in this property.
202 203 204 |
# File 'batch/ecs_fargate_container_definition.rb', line 202 def secrets() jsii_get_property("secrets") end |
#to_string ⇒ String
Returns a string representation of this construct.
216 217 218 |
# File 'batch/ecs_fargate_container_definition.rb', line 216 def to_string() jsii_call_method("toString", []) end |
#user ⇒ String?
The user name to use inside the container.
209 210 211 |
# File 'batch/ecs_fargate_container_definition.rb', line 209 def user() jsii_get_property("user") end |
#volumes ⇒ Array<AWSCDK::Batch::ECSVolume>
The volumes to mount to this container.
Automatically added to the job definition.
102 103 104 |
# File 'batch/ecs_fargate_container_definition.rb', line 102 def volumes() jsii_get_property("volumes") end |
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.
229 230 231 232 233 234 |
# File 'batch/ecs_fargate_container_definition.rb', line 229 def with(*mixins) mixins.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]") end jsii_call_method("with", [*mixins]) end |