Class: AWSCDK::ECS::LinuxParameters
- Inherits:
-
Constructs::Construct
- Object
- Constructs::Construct
- AWSCDK::ECS::LinuxParameters
- Defined in:
- ecs/linux_parameters.rb
Overview
Linux-specific options that are applied to the container.
Class Method Summary collapse
Instance Method Summary collapse
-
#add_capabilities(*cap) ⇒ void
Adds one or more Linux capabilities to the Docker configuration of a container.
-
#add_devices(*device) ⇒ void
Adds one or more host devices to a container.
-
#add_tmpfs(*tmpfs) ⇒ void
Specifies the container path, mount options, and size (in MiB) of the tmpfs mount for a container.
-
#drop_capabilities(*cap) ⇒ void
Removes one or more Linux capabilities to the Docker configuration of a container.
-
#initialize(scope, id, props = nil) ⇒ LinuxParameters
constructor
Constructs a new instance of the LinuxParameters class.
-
#node ⇒ Constructs::Node
The tree node.
-
#render_linux_parameters ⇒ AWSCDK::ECS::CfnTaskDefinition::LinuxParametersProperty
Renders the Linux parameters to a CloudFormation object.
-
#to_string ⇒ String
Returns a string representation of this construct.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Constructor Details
#initialize(scope, id, props = nil) ⇒ LinuxParameters
Constructs a new instance of the LinuxParameters class.
13 14 15 16 17 18 19 |
# File 'ecs/linux_parameters.rb', line 13 def initialize(scope, id, props = nil) props = props.is_a?(Hash) ? ::AWSCDK::ECS::LinuxParametersProps.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("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkxpbnV4UGFyYW1ldGVyc1Byb3BzIn0=")), "props") unless props.nil? 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 |
# File 'ecs/linux_parameters.rb', line 21 def self.jsii_overridable_methods { :node => { kind: :property, name: "node", is_optional: false }, :to_string => { kind: :method, name: "toString", is_optional: false }, :with => { kind: :method, name: "with", is_optional: false }, :add_capabilities => { kind: :method, name: "addCapabilities", is_optional: false }, :add_devices => { kind: :method, name: "addDevices", is_optional: false }, :add_tmpfs => { kind: :method, name: "addTmpfs", is_optional: false }, :drop_capabilities => { kind: :method, name: "dropCapabilities", is_optional: false }, :render_linux_parameters => { kind: :method, name: "renderLinuxParameters", is_optional: false }, } end |
Instance Method Details
#add_capabilities(*cap) ⇒ void
This method returns an undefined value.
Adds one or more Linux capabilities to the Docker configuration of a container.
Tasks launched on Fargate only support adding the 'SYS_PTRACE' kernel capability.
70 71 72 73 74 75 |
# File 'ecs/linux_parameters.rb', line 70 def add_capabilities(*cap) cap.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNhcGFiaWxpdHkifQ==")), "cap[#{index}]") end jsii_call_method("addCapabilities", [*cap]) end |
#add_devices(*device) ⇒ void
This method returns an undefined value.
Adds one or more host devices to a container.
81 82 83 84 85 86 87 |
# File 'ecs/linux_parameters.rb', line 81 def add_devices(*device) device.map! { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::ECS::Device.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } device.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkRldmljZSJ9")), "device[#{index}]") end jsii_call_method("addDevices", [*device]) end |
#add_tmpfs(*tmpfs) ⇒ void
This method returns an undefined value.
Specifies the container path, mount options, and size (in MiB) of the tmpfs mount for a container.
Only works with EC2 launch type.
95 96 97 98 99 100 101 |
# File 'ecs/linux_parameters.rb', line 95 def add_tmpfs(*tmpfs) tmpfs.map! { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::ECS::Tmpfs.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } tmpfs.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlRtcGZzIn0=")), "tmpfs[#{index}]") end jsii_call_method("addTmpfs", [*tmpfs]) end |
#drop_capabilities(*cap) ⇒ void
This method returns an undefined value.
Removes one or more Linux capabilities to the Docker configuration of a container.
107 108 109 110 111 112 |
# File 'ecs/linux_parameters.rb', line 107 def drop_capabilities(*cap) cap.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNhcGFiaWxpdHkifQ==")), "cap[#{index}]") end jsii_call_method("dropCapabilities", [*cap]) end |
#node ⇒ Constructs::Node
The tree node.
37 38 39 |
# File 'ecs/linux_parameters.rb', line 37 def node() jsii_get_property("node") end |
#render_linux_parameters ⇒ AWSCDK::ECS::CfnTaskDefinition::LinuxParametersProperty
Renders the Linux parameters to a CloudFormation object.
117 118 119 |
# File 'ecs/linux_parameters.rb', line 117 def render_linux_parameters() jsii_call_method("renderLinuxParameters", []) end |
#to_string ⇒ String
Returns a string representation of this construct.
44 45 46 |
# File 'ecs/linux_parameters.rb', line 44 def to_string() jsii_call_method("toString", []) 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.
57 58 59 60 61 62 |
# File 'ecs/linux_parameters.rb', line 57 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 |