Class CfnVolume
- All Implemented Interfaces:
IEnvironmentAware,IInspectable,ITaggable,IVolumeRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
When you use AWS CloudFormation to update an Amazon EBS volume that modifies Iops , Size , or VolumeType , there is a cooldown period before another operation can occur. This can cause your stack to report being in UPDATE_IN_PROGRESS or UPDATE_ROLLBACK_IN_PROGRESS for long periods of time.
Amazon EBS does not support sizing down an Amazon EBS volume. AWS CloudFormation does not attempt to modify an Amazon EBS volume to a smaller size on rollback.
Some common scenarios when you might encounter a cooldown period for Amazon EBS include:
- You successfully update an Amazon EBS volume and the update succeeds. When you attempt another update within the cooldown window, that update will be subject to a cooldown period.
- You successfully update an Amazon EBS volume and the update succeeds but another change in your
update-stackcall fails. The rollback will be subject to a cooldown period.
For more information, see Requirements for EBS volume modifications .
DeletionPolicy attribute
To control how AWS CloudFormation handles the volume when the stack is deleted, set a deletion policy for your volume. You can choose to retain the volume, to delete the volume, or to create a snapshot of the volume. For more information, see DeletionPolicy attribute .
If you set a deletion policy that creates a snapshot, all tags on the volume are included in the snapshot.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;
CfnVolume cfnVolume = CfnVolume.Builder.create(this, "MyCfnVolume")
.autoEnableIo(false)
.availabilityZone("availabilityZone")
.availabilityZoneId("availabilityZoneId")
.encrypted(false)
.iops(123)
.kmsKeyId("kmsKeyId")
.multiAttachEnabled(false)
.outpostArn("outpostArn")
.size(123)
.snapshotId("snapshotId")
.sourceVolumeId("sourceVolumeId")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.throughput(123)
.volumeInitializationRate(123)
.volumeType("volumeType")
.build();
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.services.ec2.IVolumeRef
IVolumeRef.Jsii$Default, IVolumeRef.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnVolume(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnVolume(software.amazon.jsii.JsiiObjectRef objRef) CfnVolume(software.constructs.Construct scope, String id, CfnVolumeProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IVolumeReffromVolumeId(software.constructs.Construct scope, String id, String volumeId) Creates a new IVolumeRef from a volumeId.The ID of the volume.Indicates whether the volume is auto-enabled for I/O operations.The ID of the Availability Zone in which to create the volume.Indicates whether the volume should be encrypted.getIops()The number of I/O operations per second (IOPS) to provision for the volume.The identifier of the AWS KMS key to use for Amazon EBS encryption.Indicates whether Amazon EBS Multi-Attach is enabled.The Amazon Resource Name (ARN) of the Outpost.getSize()The size of the volume, in GiBs.The snapshot from which to create the volume.getTags()Tag Manager which manages the tags for this resource.The tags to apply to the volume during creation.The throughput to provision for a volume, with a maximum of 1,000 MiB/s.Specifies the Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate), in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume.A reference to a Volume resource.The volume type.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetAutoEnableIo(Boolean value) Indicates whether the volume is auto-enabled for I/O operations.voidsetAutoEnableIo(IResolvable value) Indicates whether the volume is auto-enabled for I/O operations.voidsetAvailabilityZone(String value) The ID of the Availability Zone in which to create the volume.voidsetAvailabilityZoneId(String value) voidsetEncrypted(Boolean value) Indicates whether the volume should be encrypted.voidsetEncrypted(IResolvable value) Indicates whether the volume should be encrypted.voidThe number of I/O operations per second (IOPS) to provision for the volume.voidsetKmsKeyId(String value) The identifier of the AWS KMS key to use for Amazon EBS encryption.voidsetMultiAttachEnabled(Boolean value) Indicates whether Amazon EBS Multi-Attach is enabled.voidsetMultiAttachEnabled(IResolvable value) Indicates whether Amazon EBS Multi-Attach is enabled.voidsetOutpostArn(String value) The Amazon Resource Name (ARN) of the Outpost.voidThe size of the volume, in GiBs.voidsetSnapshotId(String value) The snapshot from which to create the volume.voidsetSourceVolumeId(String value) voidsetTagsRaw(List<CfnTag> value) The tags to apply to the volume during creation.voidsetThroughput(Number value) The throughput to provision for a volume, with a maximum of 1,000 MiB/s.voidSpecifies the Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate), in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume.voidsetVolumeType(String value) The volume type.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnVolume
protected CfnVolume(software.amazon.jsii.JsiiObjectRef objRef) -
CfnVolume
protected CfnVolume(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnVolume
@Stability(Stable) public CfnVolume(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnVolumeProps props) - Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties.
-
CfnVolume
@Stability(Stable) public CfnVolume(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.
-
-
Method Details
-
fromVolumeId
@Stability(Stable) @NotNull public static IVolumeRef fromVolumeId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String volumeId) Creates a new IVolumeRef from a volumeId.- Parameters:
scope- This parameter is required.id- This parameter is required.volumeId- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrVolumeId
The ID of the volume. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getTags
Tag Manager which manages the tags for this resource. -
getVolumeRef
A reference to a Volume resource.- Specified by:
getVolumeRefin interfaceIVolumeRef
-
getAutoEnableIo
Indicates whether the volume is auto-enabled for I/O operations.Returns union: either
BooleanorIResolvable -
setAutoEnableIo
Indicates whether the volume is auto-enabled for I/O operations. -
setAutoEnableIo
Indicates whether the volume is auto-enabled for I/O operations. -
getAvailabilityZone
The ID of the Availability Zone in which to create the volume.For example,
us-east-1a. -
setAvailabilityZone
The ID of the Availability Zone in which to create the volume.For example,
us-east-1a. -
getAvailabilityZoneId
-
setAvailabilityZoneId
-
getEncrypted
Indicates whether the volume should be encrypted.Returns union: either
BooleanorIResolvable -
setEncrypted
Indicates whether the volume should be encrypted. -
setEncrypted
Indicates whether the volume should be encrypted. -
getIops
The number of I/O operations per second (IOPS) to provision for the volume. -
setIops
The number of I/O operations per second (IOPS) to provision for the volume. -
getKmsKeyId
The identifier of the AWS KMS key to use for Amazon EBS encryption. -
setKmsKeyId
The identifier of the AWS KMS key to use for Amazon EBS encryption. -
getMultiAttachEnabled
Indicates whether Amazon EBS Multi-Attach is enabled.Returns union: either
BooleanorIResolvable -
setMultiAttachEnabled
Indicates whether Amazon EBS Multi-Attach is enabled. -
setMultiAttachEnabled
Indicates whether Amazon EBS Multi-Attach is enabled. -
getOutpostArn
The Amazon Resource Name (ARN) of the Outpost. -
setOutpostArn
The Amazon Resource Name (ARN) of the Outpost. -
getSize
The size of the volume, in GiBs. -
setSize
The size of the volume, in GiBs. -
getSnapshotId
The snapshot from which to create the volume. -
setSnapshotId
The snapshot from which to create the volume. -
getSourceVolumeId
-
setSourceVolumeId
-
getTagsRaw
The tags to apply to the volume during creation. -
setTagsRaw
The tags to apply to the volume during creation. -
getThroughput
The throughput to provision for a volume, with a maximum of 1,000 MiB/s. -
setThroughput
The throughput to provision for a volume, with a maximum of 1,000 MiB/s. -
getVolumeInitializationRate
Specifies the Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate), in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume. -
setVolumeInitializationRate
Specifies the Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate), in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume. -
getVolumeType
The volume type.This parameter can be one of the following values:.
-
setVolumeType
The volume type.This parameter can be one of the following values:.
-