Interface ServiceManagedEBSVolumeConfiguration

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
ServiceManagedEBSVolumeConfiguration.Jsii$Proxy

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-05T20:26:30.731Z") @Stability(Stable) public interface ServiceManagedEBSVolumeConfiguration extends software.amazon.jsii.JsiiSerializable
Represents the configuration for an ECS Service managed EBS volume.

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)
         .build();
 service.addVolume(volume);
 
  • Method Details

    • getEncrypted

      @Stability(Stable) @Nullable default Boolean getEncrypted()
      Indicates whether the volume should be encrypted.

      Default: - Default Amazon EBS encryption.

    • getFileSystemType

      @Stability(Stable) @Nullable default FileSystemType 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

      @Stability(Stable) @Nullable default Number 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

      @Stability(Stable) @Nullable default IKey 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

      @Stability(Stable) @Nullable default IRole 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

      @Stability(Stable) @Nullable default Size getSize()
      The size of the volume in GiB.

      You must specify either size or snapshotId. 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

      @Stability(Stable) @Nullable default String getSnapShotId()
      The snapshot that Amazon ECS uses to create the volume.

      You must specify either size or snapshotId.

      Default: - No snapshot.

    • getTagSpecifications

      @Stability(Stable) @Nullable default List<EBSTagSpecification> getTagSpecifications()
      Specifies the tags to apply to the volume and whether to propagate those tags to the volume.

      Default: - No tags are specified.

    • getThroughput

      @Stability(Stable) @Nullable default Number 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.

    • getVolumeType

      @Stability(Stable) @Nullable default EbsDeviceVolumeType getVolumeType()
      The volume type.

      Default: - ec2.EbsDeviceVolumeType.GP2

    • builder

      @Stability(Stable) static ServiceManagedEBSVolumeConfiguration.Builder builder()
      Returns:
      a ServiceManagedEBSVolumeConfiguration.Builder of ServiceManagedEBSVolumeConfiguration