Interface ServiceManagedEBSVolumeConfiguration
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
ServiceManagedEBSVolumeConfiguration.Jsii$Proxy
Example:
Cluster cluster;
FargateTaskDefinition taskDefinition = new FargateTaskDefinition(this, "TaskDef");
ContainerDefinition container = taskDefinition.addContainer("web", ContainerDefinitionOptions.builder()
.image(ContainerImage.fromRegistry("amazon/amazon-ecs-sample"))
.portMappings(List.of(PortMapping.builder()
.containerPort(80)
.protocol(Protocol.TCP)
.build()))
.build());
ServiceManagedVolume volume = ServiceManagedVolume.Builder.create(this, "EBSVolume")
.name("ebs1")
.managedEBSVolume(ServiceManagedEBSVolumeConfiguration.builder()
.size(Size.gibibytes(15))
.volumeType(EbsDeviceVolumeType.GP3)
.fileSystemType(FileSystemType.XFS)
.tagSpecifications(List.of(EBSTagSpecification.builder()
.tags(Map.of(
"purpose", "production"))
.propagateTags(EbsPropagatedTagSource.SERVICE)
.build()))
.build())
.build();
volume.mountIn(container, ContainerMountPoint.builder()
.containerPath("/var/lib")
.readOnly(false)
.build());
taskDefinition.addVolume(volume);
FargateService service = FargateService.Builder.create(this, "FargateService")
.cluster(cluster)
.taskDefinition(taskDefinition)
.minHealthyPercent(100)
.build();
service.addVolume(volume);
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forServiceManagedEBSVolumeConfigurationstatic final classAn implementation forServiceManagedEBSVolumeConfiguration -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default BooleanIndicates whether the volume should be encrypted.default FileSystemTypeThe Linux filesystem type for the volume.default NumbergetIops()The number of I/O operations per second (IOPS).default IKeyAWS Key Management Service key to use for Amazon EBS encryption.default IRolegetRole()An IAM role that allows ECS to make calls to EBS APIs on your behalf.default SizegetSize()The size of the volume in GiB.default StringThe snapshot that Amazon ECS uses to create the volume.default List<EBSTagSpecification> Specifies the tags to apply to the volume and whether to propagate those tags to the volume.default NumberThe throughput to provision for a volume, in MiB/s, with a maximum of 1,000 MiB/s.default SizeSpecifies the Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate), at which to download the snapshot blocks from Amazon S3 to the volume.default EbsDeviceVolumeTypeThe volume type.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getEncrypted
Indicates whether the volume should be encrypted.Default: - Default Amazon EBS encryption.
-
getFileSystemType
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.
Default: - FileSystemType.XFS
-
getIops
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.
Default: - undefined
-
getKmsKeyId
AWS Key Management Service key to use for Amazon EBS encryption.Default: - When `encryption` is turned on and no `kmsKey` is specified, the default AWS managed key for Amazon EBS volumes is used.
-
getRole
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.
Default: - automatically generated role.
-
getSize
The size of the volume in GiB.You must specify either
sizeorsnapshotId. 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
Default: - The snapshot size is used for the volume size if you specify `snapshotId`, otherwise this parameter is required.
-
getSnapShotId
The snapshot that Amazon ECS uses to create the volume.You must specify either
sizeorsnapshotId.Default: - No snapshot.
-
getTagSpecifications
Specifies the tags to apply to the volume and whether to propagate those tags to the volume.Default: - No tags are specified.
-
getThroughput
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.
Default: - No throughput.
-
getVolumeInitializationRate
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.
Default: undefined - The volume initialization rate is not set.
-
getVolumeType
The volume type.Default: - ec2.EbsDeviceVolumeType.GP2
-
builder
-