java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, IEnvironmentAware, IVolumeRef, ITaggableV2, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.140.0 (build 79fd58c)", date="2026-09-30T11:05:02.744Z") @Stability(Stable) public class CfnVolume extends CfnResource implements IInspectable, IVolumeRef, ITaggableV2
Creates a cached iSCSI volume on a Storage Gateway.

A cached volume stores data in Amazon S3 and retains a copy of frequently accessed data subsets locally.

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.storagegateway.*;
 CfnVolume cfnVolume = CfnVolume.Builder.create(this, "MyCfnVolume")
         .gatewayArn("gatewayArn")
         .networkInterfaceId("networkInterfaceId")
         .targetName("targetName")
         .volumeSizeInBytes(123)
         // the properties below are optional
         .kmsEncrypted(false)
         .kmsKey("kmsKey")
         .snapshotId("snapshotId")
         .sourceVolumeArn("sourceVolumeArn")
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String 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, @NotNull CfnVolumeProps props)
      Create a new AWS::StorageGateway::Volume.

      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. This parameter is required.
  • Method Details

    • arnForVolume

      @Stability(Stable) @NotNull public static String arnForVolume(@NotNull IVolumeRef resource)
      Parameters:
      resource - This parameter is required.
    • isCfnVolume

      @Stability(Stable) @NotNull public static Boolean isCfnVolume(@NotNull Object x)
      Checks whether the given object is a CfnVolume.

      Parameters:
      x - This parameter is required.
    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrCreatedDate

      @Stability(Stable) @NotNull public String getAttrCreatedDate()
      The date the volume was created.
    • getAttrTargetArn

      @Stability(Stable) @NotNull public String getAttrTargetArn()
      The Amazon Resource Name (ARN) of the volume target, which includes the iSCSI target name.
    • getAttrVolumeArn

      @Stability(Stable) @NotNull public String getAttrVolumeArn()
      The Amazon Resource Name (ARN) of the storage volume.
    • getAttrVolumeAttachmentStatus

      @Stability(Stable) @NotNull public String getAttrVolumeAttachmentStatus()
      Indicates whether the storage volume is attached to or detached from the gateway.
    • getAttrVolumeId

      @Stability(Stable) @NotNull public String getAttrVolumeId()
      The unique identifier of the volume, extracted from the ARN.
    • getAttrVolumeStatus

      @Stability(Stable) @NotNull public String getAttrVolumeStatus()
      The status of the storage volume.
    • getAttrVolumeType

      @Stability(Stable) @NotNull public String getAttrVolumeType()
      The type of the volume (CACHED iSCSI).
    • getAttrVolumeUsedInBytes

      @Stability(Stable) @NotNull public IResolvable getAttrVolumeUsedInBytes()
      The size of the data stored on the volume in bytes.
    • getCdkTagManager

      @Stability(Stable) @NotNull public TagManager getCdkTagManager()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getCdkTagManager in interface ITaggableV2
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getCfnPropertyNames

      @Stability(Stable) @NotNull protected Map<String,String> getCfnPropertyNames()
      Overrides:
      getCfnPropertyNames in class CfnResource
    • getVolumeRef

      @Stability(Stable) @NotNull public VolumeReference getVolumeRef()
      A reference to a Volume resource.
      Specified by:
      getVolumeRef in interface IVolumeRef
    • getGatewayArn

      @Stability(Stable) @NotNull public String getGatewayArn()
      The Amazon Resource Name (ARN) of the gateway on which to create the volume.
    • setGatewayArn

      @Stability(Stable) public void setGatewayArn(@NotNull String value)
      The Amazon Resource Name (ARN) of the gateway on which to create the volume.
    • getNetworkInterfaceId

      @Stability(Stable) @NotNull public String getNetworkInterfaceId()
      The network interface of the gateway on which to expose the iSCSI target.
    • setNetworkInterfaceId

      @Stability(Stable) public void setNetworkInterfaceId(@NotNull String value)
      The network interface of the gateway on which to expose the iSCSI target.
    • getTargetName

      @Stability(Stable) @NotNull public String getTargetName()
      The name of the iSCSI target used by an initiator to connect to a volume and used as a suffix for the target ARN.
    • setTargetName

      @Stability(Stable) public void setTargetName(@NotNull String value)
      The name of the iSCSI target used by an initiator to connect to a volume and used as a suffix for the target ARN.
    • getVolumeSizeInBytes

      @Stability(Stable) @NotNull public Number getVolumeSizeInBytes()
      The size of the volume in bytes.
    • setVolumeSizeInBytes

      @Stability(Stable) public void setVolumeSizeInBytes(@NotNull Number value)
      The size of the volume in bytes.
    • getKmsEncrypted

      @Stability(Stable) @Nullable public Object getKmsEncrypted()
      Set to true to use Amazon S3 server-side encryption with your own KMS key, or false to use a key managed by Amazon S3.

      Returns union: either Boolean or IResolvable

    • setKmsEncrypted

      @Stability(Stable) public void setKmsEncrypted(@Nullable Boolean value)
      Set to true to use Amazon S3 server-side encryption with your own KMS key, or false to use a key managed by Amazon S3.
    • setKmsEncrypted

      @Stability(Stable) public void setKmsEncrypted(@Nullable IResolvable value)
      Set to true to use Amazon S3 server-side encryption with your own KMS key, or false to use a key managed by Amazon S3.
    • getKmsKey

      @Stability(Stable) @Nullable public String getKmsKey()
      The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used for Amazon S3 server-side encryption.
    • setKmsKey

      @Stability(Stable) public void setKmsKey(@Nullable String value)
      The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used for Amazon S3 server-side encryption.
    • getSnapshotId

      @Stability(Stable) @Nullable public String getSnapshotId()
      The snapshot ID of the snapshot to restore as the new cached volume (e.g., snap-1122aabb).
    • setSnapshotId

      @Stability(Stable) public void setSnapshotId(@Nullable String value)
      The snapshot ID of the snapshot to restore as the new cached volume (e.g., snap-1122aabb).
    • getSourceVolumeArn

      @Stability(Stable) @Nullable public String getSourceVolumeArn()
      The ARN of an existing volume from which to create the new volume.
    • setSourceVolumeArn

      @Stability(Stable) public void setSourceVolumeArn(@Nullable String value)
      The ARN of an existing volume from which to create the new volume.
    • getTags

      @Stability(Stable) @Nullable public List<CfnTag> getTags()
      A list of up to 50 tags to assign to the volume.
    • setTags

      @Stability(Stable) public void setTags(@Nullable List<CfnTag> value)
      A list of up to 50 tags to assign to the volume.