Interface ServiceManagedVolumeProps

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

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:06.644Z") @Stability(Stable) public interface ServiceManagedVolumeProps extends software.amazon.jsii.JsiiSerializable
Represents the Volume configuration for an ECS service.

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);