Class: AWSCDK::ECS::CfnDaemonTaskDefinition::VolumeProperty

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

Overview

The data volume configuration for tasks launched using this task definition.

Specifying a volume configuration in a task definition is optional. The volume configuration may contain multiple volumes but only one volume configured at launch is supported. Each volume defined in the volume configuration may only specify a name and one of either configured_at_launch, docker_volume_configuration, efs_volume_configuration, s3files_volume_configuration, fsx_windows_file_server_volume_configuration, or host. If an empty volume configuration is specified, by default Amazon ECS uses a host volume. For more information, see Using data volumes in tasks.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host: nil, name: nil) ⇒ VolumeProperty

Returns a new instance of VolumeProperty.

Parameters:



2076
2077
2078
2079
2080
2081
# File 'ecs/cfn_daemon_task_definition.rb', line 2076

def initialize(host: nil, name: nil)
  @host = host.is_a?(Hash) ? ::AWSCDK::ECS::CfnDaemonTaskDefinition::HostVolumePropertiesProperty.new(**host.transform_keys(&:to_sym)) : host
  Jsii::Type.check_type(@host, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuRGFlbW9uVGFza0RlZmluaXRpb24uSG9zdFZvbHVtZVByb3BlcnRpZXNQcm9wZXJ0eSJ9XX19")), "host") unless @host.nil?
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
end

Instance Attribute Details

#hostAWSCDK::IResolvable, ... (readonly)

Details on a container instance bind mount host volume.



2087
2088
2089
# File 'ecs/cfn_daemon_task_definition.rb', line 2087

def host
  @host
end

#nameString? (readonly)

The name of the volume.

Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed. When using a volume configured at launch, the name is required and must also be specified as the volume name in the ServiceVolumeConfiguration or TaskVolumeConfiguration parameter when creating your service or standalone task. For all other types of volumes, this name is referenced in the source_volume parameter of the mount_points object in the container definition. When a volume is using the efs_volume_configuration, the name is required. When a volume is using the s3files_volume_configuration, the name is required.



2098
2099
2100
# File 'ecs/cfn_daemon_task_definition.rb', line 2098

def name
  @name
end

Class Method Details

.jsii_propertiesObject



2100
2101
2102
2103
2104
2105
# File 'ecs/cfn_daemon_task_definition.rb', line 2100

def self.jsii_properties
  {
    :host => "host",
    :name => "name",
  }
end

Instance Method Details

#to_jsiiObject



2107
2108
2109
2110
2111
2112
2113
2114
# File 'ecs/cfn_daemon_task_definition.rb', line 2107

def to_jsii
  result = {}
  result.merge!({
    "host" => @host,
    "name" => @name,
  })
  result.compact
end