Class: AWSCDK::ECS::CfnService::ServiceManagedEBSVolumeConfigurationProperty

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

Overview

The configuration for the Amazon EBS volume that Amazon ECS creates and manages on your behalf.

These settings are used to create each Amazon EBS volume, with one volume created for each task in the service. For information about the supported launch types and operating systems, see Supported operating systems and launch types in the Amazon Elastic Container Service Developer Guide .

Many of these parameters map 1:1 with the Amazon EBS CreateVolume API request parameters.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(role_arn:, encrypted: nil, filesystem_type: nil, iops: nil, kms_key_id: nil, size_in_gib: nil, snapshot_id: nil, tag_specifications: nil, throughput: nil, volume_initialization_rate: nil, volume_type: nil) ⇒ ServiceManagedEBSVolumeConfigurationProperty

Returns a new instance of ServiceManagedEBSVolumeConfigurationProperty.

Parameters:

  • role_arn (String)

    The ARN of the IAM role to associate with this volume.

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

    Indicates whether the volume should be encrypted.

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

    The filesystem type for the volume.

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

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

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

    The Amazon Resource Name (ARN) identifier of the AWS Key Management Service key to use for Amazon EBS encryption.

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

    The size of the volume in GiB.

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

    The snapshot that Amazon ECS uses to create volumes for attachment to tasks maintained by the service.

  • tag_specifications (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::ECS::CfnService::EBSTagSpecificationProperty>, nil) (defaults to: nil)

    The tags to apply 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 (Numeric, nil) (defaults to: nil)

    The rate, in MiB/s, at which data is fetched from a snapshot of an existing EBS volume to create new volumes for attachment to the tasks maintained by the service.

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

    The volume type.



2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
# File 'ecs/cfn_service.rb', line 2935

def initialize(role_arn:, encrypted: nil, filesystem_type: nil, iops: nil, kms_key_id: nil, size_in_gib: nil, snapshot_id: nil, tag_specifications: nil, throughput: nil, volume_initialization_rate: nil, volume_type: nil)
  @role_arn = role_arn
  Jsii::Type.check_type(@role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "roleArn")
  @encrypted = encrypted
  Jsii::Type.check_type(@encrypted, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "encrypted") unless @encrypted.nil?
  @filesystem_type = filesystem_type
  Jsii::Type.check_type(@filesystem_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "filesystemType") unless @filesystem_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("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "kmsKeyId") unless @kms_key_id.nil?
  @size_in_gib = size_in_gib
  Jsii::Type.check_type(@size_in_gib, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "sizeInGiB") unless @size_in_gib.nil?
  @snapshot_id = snapshot_id
  Jsii::Type.check_type(@snapshot_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "snapshotId") unless @snapshot_id.nil?
  @tag_specifications = tag_specifications
  Jsii::Type.check_type(@tag_specifications, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmblNlcnZpY2UuRUJTVGFnU3BlY2lmaWNhdGlvblByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "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("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "volumeInitializationRate") unless @volume_initialization_rate.nil?
  @volume_type = volume_type
  Jsii::Type.check_type(@volume_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "volumeType") unless @volume_type.nil?
end

Instance Attribute Details

#encryptedBoolean, ... (readonly)

Indicates whether the volume should be encrypted.

If you turn on Region-level Amazon EBS encryption by default but set this value as false , the setting is overridden and the volume is encrypted with the KMS key specified for Amazon EBS encryption by default. This parameter maps 1:1 with the Encrypted parameter of the CreateVolume API in the Amazon EC2 API Reference .



2973
2974
2975
# File 'ecs/cfn_service.rb', line 2973

def encrypted
  @encrypted
end

#filesystem_typeString? (readonly)

The 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. If there is a filesystem type mismatch, the tasks will fail to start.

The available Linux filesystem types are ext3 , ext4 , and xfs . If no value is specified, the xfs filesystem type is used by default.

The available Windows filesystem types are NTFS .



2984
2985
2986
# File 'ecs/cfn_service.rb', line 2984

def filesystem_type
  @filesystem_type
end

#iopsNumeric? (readonly)

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.

This parameter maps 1:1 with the Iops parameter of the CreateVolume API in the Amazon EC2 API Reference .



3001
3002
3003
# File 'ecs/cfn_service.rb', line 3001

def iops
  @iops
end

#kms_key_idString? (readonly)

The Amazon Resource Name (ARN) identifier of the AWS Key Management Service key to use for Amazon EBS encryption.

When a key is specified using this parameter, it overrides Amazon EBS default encryption or any KMS key that you specified for cluster-level managed storage encryption. This parameter maps 1:1 with the KmsKeyId parameter of the CreateVolume API in the Amazon EC2 API Reference . For more information about encrypting Amazon EBS volumes attached to tasks, see Encrypt data stored in Amazon EBS volumes attached to Amazon ECS tasks .

AWS authenticates the AWS Key Management Service key asynchronously. Therefore, if you specify an ID, alias, or ARN that is invalid, the action can appear to complete, but eventually fails.



3010
3011
3012
# File 'ecs/cfn_service.rb', line 3010

def kms_key_id
  @kms_key_id
end

#role_arnString (readonly)

The ARN of the IAM role to associate with this volume.

This is the Amazon ECS infrastructure IAM role that is used to manage your AWS infrastructure. We recommend using the Amazon ECS-managed AmazonECSInfrastructureRolePolicyForVolumes IAM policy with this role. For more information, see Amazon ECS infrastructure IAM role in the Amazon ECS Developer Guide .



2966
2967
2968
# File 'ecs/cfn_service.rb', line 2966

def role_arn
  @role_arn
end

#size_in_gibNumeric? (readonly)

The size of the volume in GiB.

You must specify either a volume size or a snapshot ID. If you specify a snapshot ID, the snapshot size is used for the volume size by default. You can optionally specify a volume size greater than or equal to the snapshot size. This parameter maps 1:1 with the Size parameter of the CreateVolume API in the Amazon EC2 API Reference .

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


3024
3025
3026
# File 'ecs/cfn_service.rb', line 3024

def size_in_gib
  @size_in_gib
end

#snapshot_idString? (readonly)

The snapshot that Amazon ECS uses to create volumes for attachment to tasks maintained by the service.

You must specify either snapshot_id or size_in_gib in your volume configuration. This parameter maps 1:1 with the SnapshotId parameter of the CreateVolume API in the Amazon EC2 API Reference .



3031
3032
3033
# File 'ecs/cfn_service.rb', line 3031

def snapshot_id
  @snapshot_id
end

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

The tags to apply to the volume.

Amazon ECS applies service-managed tags by default. This parameter maps 1:1 with the TagSpecifications.N parameter of the CreateVolume API in the Amazon EC2 API Reference .



3038
3039
3040
# File 'ecs/cfn_service.rb', line 3038

def tag_specifications
  @tag_specifications
end

#throughputNumeric? (readonly)

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

This parameter maps 1:1 with the Throughput parameter of the CreateVolume API in the Amazon EC2 API Reference .

This parameter is only supported for the gp3 volume type.



3047
3048
3049
# File 'ecs/cfn_service.rb', line 3047

def throughput
  @throughput
end

#volume_initialization_rateNumeric? (readonly)

The rate, in MiB/s, at which data is fetched from a snapshot of an existing EBS volume to create new volumes for attachment to the tasks maintained by the service.

This property can be specified only if you specify a snapshot_id . For more information, see Initialize Amazon EBS volumes in the Amazon EBS User Guide .



3054
3055
3056
# File 'ecs/cfn_service.rb', line 3054

def volume_initialization_rate
  @volume_initialization_rate
end

#volume_typeString? (readonly)

The volume type.

This parameter maps 1:1 with the VolumeType parameter of the CreateVolume API in the Amazon EC2 API Reference . For more information, see Amazon EBS volume types in the Amazon EC2 User Guide .

The following are the supported volume types.

  • General Purpose SSD: gp2 | gp3
  • Provisioned IOPS SSD: io1 | io2
  • Throughput Optimized HDD: st1
  • Cold HDD: sc1
  • Magnetic: standard

The magnetic volume type is not supported on Fargate.



3071
3072
3073
# File 'ecs/cfn_service.rb', line 3071

def volume_type
  @volume_type
end

Class Method Details

.jsii_propertiesObject



3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
# File 'ecs/cfn_service.rb', line 3073

def self.jsii_properties
  {
    :role_arn => "roleArn",
    :encrypted => "encrypted",
    :filesystem_type => "filesystemType",
    :iops => "iops",
    :kms_key_id => "kmsKeyId",
    :size_in_gib => "sizeInGiB",
    :snapshot_id => "snapshotId",
    :tag_specifications => "tagSpecifications",
    :throughput => "throughput",
    :volume_initialization_rate => "volumeInitializationRate",
    :volume_type => "volumeType",
  }
end

Instance Method Details

#to_jsiiObject



3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
# File 'ecs/cfn_service.rb', line 3089

def to_jsii
  result = {}
  result.merge!({
    "roleArn" => @role_arn,
    "encrypted" => @encrypted,
    "filesystemType" => @filesystem_type,
    "iops" => @iops,
    "kmsKeyId" => @kms_key_id,
    "sizeInGiB" => @size_in_gib,
    "snapshotId" => @snapshot_id,
    "tagSpecifications" => @tag_specifications,
    "throughput" => @throughput,
    "volumeInitializationRate" => @volume_initialization_rate,
    "volumeType" => @volume_type,
  })
  result.compact
end