Class: AWSCDK::ECS::ServiceManagedEBSVolumeConfiguration

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

Overview

Represents the configuration for an ECS Service managed EBS volume.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(encrypted: nil, file_system_type: nil, iops: nil, kms_key_id: nil, role: nil, size: nil, snap_shot_id: nil, tag_specifications: nil, throughput: nil, volume_initialization_rate: nil, volume_type: nil) ⇒ ServiceManagedEBSVolumeConfiguration

Returns a new instance of ServiceManagedEBSVolumeConfiguration.

Parameters:

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

    Indicates whether the volume should be encrypted.

  • file_system_type (AWSCDK::ECS::FileSystemType, nil) (defaults to: nil)

    The Linux filesystem type for the volume.

  • iops (Numeric, nil) (defaults to: nil)

    The number of I/O operations per second (IOPS).

  • kms_key_id (AWSCDK::KMS::IKey, nil) (defaults to: nil)

    AWS Key Management Service key to use for Amazon EBS encryption.

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

    An IAM role that allows ECS to make calls to EBS APIs on your behalf.

  • size (AWSCDK::Size, nil) (defaults to: nil)

    The size of the volume in GiB.

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

    The snapshot that Amazon ECS uses to create the volume.

  • tag_specifications (Array<AWSCDK::ECS::EBSTagSpecification>, nil) (defaults to: nil)

    Specifies the tags to apply to the volume and whether to propagate those tags to the volume.

  • throughput (Numeric, nil) (defaults to: nil)

    The throughput to provision for a volume, in MiB/s, with a maximum of 1,000 MiB/s.

  • volume_initialization_rate (AWSCDK::Size, nil) (defaults to: nil)

    Specifies the Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate), at which to download the snapshot blocks from Amazon S3 to the volume.

  • volume_type (AWSCDK::EC2::EbsDeviceVolumeType, nil) (defaults to: nil)

    The volume type.



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/service_managed_ebs_volume_configuration.rb', line 18

def initialize(encrypted: nil, file_system_type: nil, iops: nil, kms_key_id: nil, role: nil, size: nil, snap_shot_id: nil, tag_specifications: nil, throughput: nil, volume_initialization_rate: nil, volume_type: nil)
  @encrypted = encrypted
  Jsii::Type.check_type(@encrypted, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "encrypted") unless @encrypted.nil?
  @file_system_type = file_system_type
  Jsii::Type.check_type(@file_system_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkZpbGVTeXN0ZW1UeXBlIn0=")), "fileSystemType") unless @file_system_type.nil?
  @iops = iops
  Jsii::Type.check_type(@iops, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "iops") unless @iops.nil?
  @kms_key_id = kms_key_id
  Jsii::Type.check_type(@kms_key_id, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfa21zLklLZXkifQ==")), "kmsKeyId") unless @kms_key_id.nil?
  @role = role
  Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil?
  @size = size
  Jsii::Type.check_type(@size, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TaXplIn0=")), "size") unless @size.nil?
  @snap_shot_id = snap_shot_id
  Jsii::Type.check_type(@snap_shot_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "snapShotId") unless @snap_shot_id.nil?
  @tag_specifications = tag_specifications.is_a?(Array) ? tag_specifications.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::ECS::EBSTagSpecification.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tag_specifications
  Jsii::Type.check_type(@tag_specifications, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuRUJTVGFnU3BlY2lmaWNhdGlvbiJ9LCJraW5kIjoiYXJyYXkifX0=")), "tagSpecifications") unless @tag_specifications.nil?
  @throughput = throughput
  Jsii::Type.check_type(@throughput, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "throughput") unless @throughput.nil?
  @volume_initialization_rate = volume_initialization_rate
  Jsii::Type.check_type(@volume_initialization_rate, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TaXplIn0=")), "volumeInitializationRate") unless @volume_initialization_rate.nil?
  @volume_type = volume_type
  Jsii::Type.check_type(@volume_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkVic0RldmljZVZvbHVtZVR5cGUifQ==")), "volumeType") unless @volume_type.nil?
end

Instance Attribute Details

#encryptedBoolean? (readonly)

Note:

Default: - Default Amazon EBS encryption.

Indicates whether the volume should be encrypted.

Returns:

  • (Boolean, nil)


47
48
49
# File 'ecs/service_managed_ebs_volume_configuration.rb', line 47

def encrypted
  @encrypted
end

#file_system_typeAWSCDK::ECS::FileSystemType? (readonly)

Note:

Default: - FileSystemType.XFS

The Linux filesystem type for the volume.

For volumes created from a snapshot, you must specify the same filesystem type that the volume was using when the snapshot was created. The available filesystem types are ext3, ext4, and xfs.

Returns:



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

def file_system_type
  @file_system_type
end

#iopsNumeric? (readonly)

Note:

Default: - undefined

The number of I/O operations per second (IOPS).

For gp3, io1, and io2 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.

The following are the supported values for each volume type.

  • gp3: 3,000 - 16,000 IOPS
  • io1: 100 - 64,000 IOPS
  • io2: 100 - 256,000 IOPS

This parameter is required for io1 and io2 volume types. The default for gp3 volumes is 3,000 IOPS. This parameter is not supported for st1, sc1, or standard volume types.

Returns:

  • (Numeric, nil)


74
75
76
# File 'ecs/service_managed_ebs_volume_configuration.rb', line 74

def iops
  @iops
end

#kms_key_idAWSCDK::KMS::IKey? (readonly)

Note:

Default: - When encryption is turned on and no kmsKey is specified, the default AWS managed key for Amazon EBS volumes is used.

AWS Key Management Service key to use for Amazon EBS encryption.

Returns:



79
80
81
# File 'ecs/service_managed_ebs_volume_configuration.rb', line 79

def kms_key_id
  @kms_key_id
end

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

Note:

Default: - automatically generated role.

An IAM role that allows ECS to make calls to EBS APIs on your behalf.

This role is required to create and manage the Amazon EBS volume.

Returns:



86
87
88
# File 'ecs/service_managed_ebs_volume_configuration.rb', line 86

def role
  @role
end

#sizeAWSCDK::Size? (readonly)

Note:

Default: - The snapshot size is used for the volume size if you specify snapshotId, otherwise this parameter is required.

The size of the volume in GiB.

You must specify either size or snapshot_id. You can optionally specify a volume size greater than or equal to the snapshot size.

The following are the supported volume size values for each volume type.

  • gp2 and gp3: 1-16,384
  • io1 and io2: 4-16,384
  • st1 and sc1: 125-16,384
  • standard: 1-1,024

Returns:



101
102
103
# File 'ecs/service_managed_ebs_volume_configuration.rb', line 101

def size
  @size
end

#snap_shot_idString? (readonly)

Note:

Default: - No snapshot.

The snapshot that Amazon ECS uses to create the volume.

You must specify either size or snapshot_id.

Returns:

  • (String, nil)


108
109
110
# File 'ecs/service_managed_ebs_volume_configuration.rb', line 108

def snap_shot_id
  @snap_shot_id
end

#tag_specificationsArray<AWSCDK::ECS::EBSTagSpecification>? (readonly)

Note:

Default: - No tags are specified.

Specifies the tags to apply to the volume and whether to propagate those tags to the volume.

Returns:



113
114
115
# File 'ecs/service_managed_ebs_volume_configuration.rb', line 113

def tag_specifications
  @tag_specifications
end

#throughputNumeric? (readonly)

Note:

Default: - No throughput.

The throughput to provision for a volume, in MiB/s, with a maximum of 1,000 MiB/s.

This parameter is only supported for the gp3 volume type.

Returns:

  • (Numeric, nil)


120
121
122
# File 'ecs/service_managed_ebs_volume_configuration.rb', line 120

def throughput
  @throughput
end

#volume_initialization_rateAWSCDK::Size? (readonly)

Note:

Default: undefined - The volume initialization rate is not set.

Specifies the Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate), at which to download the snapshot blocks from Amazon S3 to the volume.

Valid range is between 100 and 300 MiB/s.

Returns:



127
128
129
# File 'ecs/service_managed_ebs_volume_configuration.rb', line 127

def volume_initialization_rate
  @volume_initialization_rate
end

#volume_typeAWSCDK::EC2::EbsDeviceVolumeType? (readonly)

Note:

Default: - ec2.EbsDeviceVolumeType.GP2

The volume type.



132
133
134
# File 'ecs/service_managed_ebs_volume_configuration.rb', line 132

def volume_type
  @volume_type
end

Class Method Details

.jsii_propertiesObject



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'ecs/service_managed_ebs_volume_configuration.rb', line 134

def self.jsii_properties
  {
    :encrypted => "encrypted",
    :file_system_type => "fileSystemType",
    :iops => "iops",
    :kms_key_id => "kmsKeyId",
    :role => "role",
    :size => "size",
    :snap_shot_id => "snapShotId",
    :tag_specifications => "tagSpecifications",
    :throughput => "throughput",
    :volume_initialization_rate => "volumeInitializationRate",
    :volume_type => "volumeType",
  }
end

Instance Method Details

#to_jsiiObject



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'ecs/service_managed_ebs_volume_configuration.rb', line 150

def to_jsii
  result = {}
  result.merge!({
    "encrypted" => @encrypted,
    "fileSystemType" => @file_system_type,
    "iops" => @iops,
    "kmsKeyId" => @kms_key_id,
    "role" => @role,
    "size" => @size,
    "snapShotId" => @snap_shot_id,
    "tagSpecifications" => @tag_specifications,
    "throughput" => @throughput,
    "volumeInitializationRate" => @volume_initialization_rate,
    "volumeType" => @volume_type,
  })
  result.compact
end