Class Volume
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.ec2.Volume
- All Implemented Interfaces:
IVolumeRef,IEnvironmentAware,IResource,IVolume,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.126.0 (build 206d44b)",
date="2026-02-09T14:39:09.953Z")
@Stability(Stable)
public class Volume
extends Resource
implements IVolume
Creates a new EBS Volume in AWS EC2.
Example:
Volume.Builder.create(this, "Volume")
.availabilityZone("us-east-1a")
.size(Size.gibibytes(125))
.volumeType(EbsDeviceVolumeType.GP3)
.throughput(125)
.build();
-
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.IResource
IResource.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.ec2.IVolume
IVolume.Jsii$Default, IVolume.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedVolume(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedVolume(software.amazon.jsii.JsiiObjectRef objRef) Volume(software.constructs.Construct scope, String id, VolumeProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IVolumefromVolumeAttributes(software.constructs.Construct scope, String id, VolumeAttributes attrs) Import an existing EBS Volume into the Stack.The availability zone that the EBS Volume is contained within (ex: us-west-2a).The customer-managed encryption key that is used to encrypt the Volume.The EBS Volume's ID.A reference to a Volume resource.grantAttachVolume(IGrantable grantee) [disable-awslint:no-grants].grantAttachVolume(IGrantable grantee, List<IInstanceRef> instances) [disable-awslint:no-grants].grantAttachVolumeByResourceTag(IGrantable grantee, List<software.constructs.Construct> constructs) [disable-awslint:no-grants].grantAttachVolumeByResourceTag(IGrantable grantee, List<software.constructs.Construct> constructs, String tagKeySuffix) [disable-awslint:no-grants].grantDetachVolume(IGrantable grantee) [disable-awslint:no-grants].grantDetachVolume(IGrantable grantee, List<IInstanceRef> instances) [disable-awslint:no-grants].grantDetachVolumeByResourceTag(IGrantable grantee, List<software.constructs.Construct> constructs) [disable-awslint:no-grants].grantDetachVolumeByResourceTag(IGrantable grantee, List<software.constructs.Construct> constructs, String tagKeySuffix) [disable-awslint:no-grants].protected voidvalidateProps(VolumeProps props) Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods 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.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
Constructor Details
-
Volume
protected Volume(software.amazon.jsii.JsiiObjectRef objRef) -
Volume
protected Volume(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
Volume
@Stability(Stable) public Volume(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull VolumeProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
fromVolumeAttributes
@Stability(Stable) @NotNull public static IVolume fromVolumeAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull VolumeAttributes attrs) Import an existing EBS Volume into the Stack.- Parameters:
scope- the scope of the import. This parameter is required.id- the ID of the imported Volume in the construct tree. This parameter is required.attrs- the attributes of the imported Volume. This parameter is required.
-
grantAttachVolume
@Stability(Stable) @NotNull public Grant grantAttachVolume(@NotNull IGrantable grantee, @Nullable List<IInstanceRef> instances) [disable-awslint:no-grants].- Specified by:
grantAttachVolumein interfaceIVolume- Parameters:
grantee- This parameter is required.instances-
-
grantAttachVolume
[disable-awslint:no-grants].- Specified by:
grantAttachVolumein interfaceIVolume- Parameters:
grantee- This parameter is required.
-
grantAttachVolumeByResourceTag
@Stability(Stable) @NotNull public Grant grantAttachVolumeByResourceTag(@NotNull IGrantable grantee, @NotNull List<software.constructs.Construct> constructs, @Nullable String tagKeySuffix) [disable-awslint:no-grants].- Specified by:
grantAttachVolumeByResourceTagin interfaceIVolume- Parameters:
grantee- This parameter is required.constructs- This parameter is required.tagKeySuffix-
-
grantAttachVolumeByResourceTag
@Stability(Stable) @NotNull public Grant grantAttachVolumeByResourceTag(@NotNull IGrantable grantee, @NotNull List<software.constructs.Construct> constructs) [disable-awslint:no-grants].- Specified by:
grantAttachVolumeByResourceTagin interfaceIVolume- Parameters:
grantee- This parameter is required.constructs- This parameter is required.
-
grantDetachVolume
@Stability(Stable) @NotNull public Grant grantDetachVolume(@NotNull IGrantable grantee, @Nullable List<IInstanceRef> instances) [disable-awslint:no-grants].- Specified by:
grantDetachVolumein interfaceIVolume- Parameters:
grantee- This parameter is required.instances-
-
grantDetachVolume
[disable-awslint:no-grants].- Specified by:
grantDetachVolumein interfaceIVolume- Parameters:
grantee- This parameter is required.
-
grantDetachVolumeByResourceTag
@Stability(Stable) @NotNull public Grant grantDetachVolumeByResourceTag(@NotNull IGrantable grantee, @NotNull List<software.constructs.Construct> constructs, @Nullable String tagKeySuffix) [disable-awslint:no-grants].- Specified by:
grantDetachVolumeByResourceTagin interfaceIVolume- Parameters:
grantee- This parameter is required.constructs- This parameter is required.tagKeySuffix-
-
grantDetachVolumeByResourceTag
@Stability(Stable) @NotNull public Grant grantDetachVolumeByResourceTag(@NotNull IGrantable grantee, @NotNull List<software.constructs.Construct> constructs) [disable-awslint:no-grants].- Specified by:
grantDetachVolumeByResourceTagin interfaceIVolume- Parameters:
grantee- This parameter is required.constructs- This parameter is required.
-
validateProps
- Parameters:
props- This parameter is required.
-
getAvailabilityZone
The availability zone that the EBS Volume is contained within (ex: us-west-2a).- Specified by:
getAvailabilityZonein interfaceIVolume
-
getVolumeId
The EBS Volume's ID.- Specified by:
getVolumeIdin interfaceIVolume
-
getVolumeRef
A reference to a Volume resource.- Specified by:
getVolumeRefin interfaceIVolumeRef
-
getEncryptionKey
The customer-managed encryption key that is used to encrypt the Volume.- Specified by:
getEncryptionKeyin interfaceIVolume
-