Interface IServiceManagedEBSVolumeConfiguration
Represents the configuration for an ECS Service managed EBS volume.
Namespace: Amazon.CDK.AWS.ECS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IServiceManagedEBSVolumeConfiguration
Syntax (vb)
Public Interface IServiceManagedEBSVolumeConfiguration
Remarks
ExampleMetadata: infused
Examples
Cluster cluster;
var taskDefinition = new FargateTaskDefinition(this, "TaskDef");
var container = taskDefinition.AddContainer("web", new ContainerDefinitionOptions {
Image = ContainerImage.FromRegistry("amazon/amazon-ecs-sample"),
PortMappings = new [] { new PortMapping {
ContainerPort = 80,
Protocol = Protocol.TCP
} }
});
var volume = new ServiceManagedVolume(this, "EBSVolume", new ServiceManagedVolumeProps {
Name = "ebs1",
ManagedEBSVolume = new ServiceManagedEBSVolumeConfiguration {
Size = Size.Gibibytes(15),
VolumeType = EbsDeviceVolumeType.GP3,
FileSystemType = FileSystemType.XFS,
TagSpecifications = new [] { new EBSTagSpecification {
Tags = new Dictionary<string, string> {
{ "purpose", "production" }
},
PropagateTags = EbsPropagatedTagSource.SERVICE
} }
}
});
volume.MountIn(container, new ContainerMountPoint {
ContainerPath = "/var/lib",
ReadOnly = false
});
taskDefinition.AddVolume(volume);
var service = new FargateService(this, "FargateService", new FargateServiceProps {
Cluster = cluster,
TaskDefinition = taskDefinition
});
service.AddVolume(volume);
Synopsis
Properties
Encrypted | Indicates whether the volume should be encrypted. |
FileSystemType | The Linux filesystem type for the volume. |
Iops | The number of I/O operations per second (IOPS). |
KmsKeyId | AWS Key Management Service key to use for Amazon EBS encryption. |
Role | An IAM role that allows ECS to make calls to EBS APIs on your behalf. |
Size | The size of the volume in GiB. |
SnapShotId | The snapshot that Amazon ECS uses to create the volume. |
TagSpecifications | Specifies the tags to apply to the volume and whether to propagate those tags to the volume. |
Throughput | The throughput to provision for a volume, in MiB/s, with a maximum of 1,000 MiB/s. |
VolumeType | The volume type. |
Properties
Encrypted
Indicates whether the volume should be encrypted.
virtual Nullable<bool> Encrypted { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - Default Amazon EBS encryption.
FileSystemType
The Linux filesystem type for the volume.
virtual Nullable<FileSystemType> FileSystemType { get; }
Property Value
System.Nullable<FileSystemType>
Remarks
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
Iops
The number of I/O operations per second (IOPS).
virtual Nullable<double> Iops { get; }
Property Value
System.Nullable<System.Double>
Remarks
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.
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
KmsKeyId
AWS Key Management Service key to use for Amazon EBS encryption.
virtual IKey KmsKeyId { get; }
Property Value
Remarks
Default: - When encryption
is turned on and no kmsKey
is specified,
the default AWS managed key for Amazon EBS volumes is used.
Role
An IAM role that allows ECS to make calls to EBS APIs on your behalf.
virtual IRole Role { get; }
Property Value
Remarks
This role is required to create and manage the Amazon EBS volume.
Default: - automatically generated role.
Size
The size of the volume in GiB.
virtual Size Size { get; }
Property Value
Remarks
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.
Default: - The snapshot size is used for the volume size if you specify snapshotId
,
otherwise this parameter is required.
SnapShotId
The snapshot that Amazon ECS uses to create the volume.
virtual string SnapShotId { get; }
Property Value
System.String
Remarks
You must specify either size
or snapshotId
.
Default: - No snapshot.
TagSpecifications
Specifies the tags to apply to the volume and whether to propagate those tags to the volume.
virtual IEBSTagSpecification[] TagSpecifications { get; }
Property Value
Remarks
Default: - No tags are specified.
Throughput
The throughput to provision for a volume, in MiB/s, with a maximum of 1,000 MiB/s.
virtual Nullable<double> Throughput { get; }
Property Value
System.Nullable<System.Double>
Remarks
This parameter is only supported for the gp3 volume type.
Default: - No throughput.
VolumeType
The volume type.
virtual Nullable<EbsDeviceVolumeType> VolumeType { get; }
Property Value
System.Nullable<EbsDeviceVolumeType>
Remarks
Default: - ec2.EbsDeviceVolumeType.GP2