Interface IVolume.Jsii$Default

All Superinterfaces:
IConstruct, software.constructs.IConstruct, IConstruct.Jsii$Default, software.constructs.IConstruct.Jsii$Default, IDependable, IDependable.Jsii$Default, IResource, IResource.Jsii$Default, IVolume, software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
IVolume.Jsii$Proxy
Enclosing interface:
IVolume

@Internal public static interface IVolume.Jsii$Default extends IVolume, IResource.Jsii$Default
Internal default implementation for IVolume.
  • Method Details

    • getNode

      @Stability(Stable) @NotNull default ConstructNode getNode()
      The construct tree node for this construct.
      Specified by:
      getNode in interface IConstruct
      Specified by:
      getNode in interface IConstruct.Jsii$Default
      Specified by:
      getNode in interface IResource.Jsii$Default
    • getEnv

      @Stability(Stable) @NotNull default ResourceEnvironment getEnv()
      The environment this resource belongs to.

      For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.

      Specified by:
      getEnv in interface IResource
      Specified by:
      getEnv in interface IResource.Jsii$Default
    • getStack

      @Stability(Stable) @NotNull default Stack getStack()
      The stack in which this resource is defined.
      Specified by:
      getStack in interface IResource
      Specified by:
      getStack in interface IResource.Jsii$Default
    • getAvailabilityZone

      @Stability(Stable) @NotNull default String getAvailabilityZone()
      The availability zone that the EBS Volume is contained within (ex: us-west-2a).
      Specified by:
      getAvailabilityZone in interface IVolume
    • getVolumeId

      @Stability(Stable) @NotNull default String getVolumeId()
      The EBS Volume's ID.
      Specified by:
      getVolumeId in interface IVolume
    • getEncryptionKey

      @Stability(Stable) @Nullable default IKey getEncryptionKey()
      The customer-managed encryption key that is used to encrypt the Volume.
      Specified by:
      getEncryptionKey in interface IVolume
    • applyRemovalPolicy

      @Stability(Stable) default void applyRemovalPolicy(@NotNull RemovalPolicy policy)
      Apply the given removal policy to this resource.

      The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

      The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

      Specified by:
      applyRemovalPolicy in interface IResource
      Specified by:
      applyRemovalPolicy in interface IResource.Jsii$Default
      Parameters:
      policy - This parameter is required.
    • grantAttachVolume

      @Stability(Stable) @NotNull default Grant grantAttachVolume(@NotNull IGrantable grantee, @Nullable List<IInstance> instances)
      Grants permission to attach this Volume to an instance.

      CAUTION: Granting an instance permission to attach to itself using this method will lead to an unresolvable circular reference between the instance role and the instance. Use

      invalid @link
      IVolume.grantAttachVolumeToSelf
      to grant an instance permission to attach this volume to itself.

      Specified by:
      grantAttachVolume in interface IVolume
      Parameters:
      grantee - the principal being granted permission. This parameter is required.
      instances - the instances to which permission is being granted to attach this volume to.
    • grantAttachVolumeByResourceTag

      @Stability(Stable) @NotNull default Grant grantAttachVolumeByResourceTag(@NotNull IGrantable grantee, @NotNull List<software.constructs.Construct> constructs, @Nullable String tagKeySuffix)
      Grants permission to attach the Volume by a ResourceTag condition.

      If you are looking to grant an Instance, AutoScalingGroup, EC2-Fleet, SpotFleet, ECS host, etc the ability to attach this volume to itself then this is the method you want to use.

      This is implemented by adding a Tag with key VolumeGrantAttach-<suffix> to the given constructs and this Volume, and then conditioning the Grant such that the grantee is only given the ability to AttachVolume if both the Volume and the destination Instance have that tag applied to them.

      Specified by:
      grantAttachVolumeByResourceTag in interface IVolume
      Parameters:
      grantee - the principal being granted permission. This parameter is required.
      constructs - The list of constructs that will have the generated resource tag applied to them. This parameter is required.
      tagKeySuffix - A suffix to use on the generated Tag key in place of the generated hash value.
    • grantDetachVolume

      @Stability(Stable) @NotNull default Grant grantDetachVolume(@NotNull IGrantable grantee, @Nullable List<IInstance> instances)
      Grants permission to detach this Volume from an instance CAUTION: Granting an instance permission to detach from itself using this method will lead to an unresolvable circular reference between the instance role and the instance.

      Use

      invalid @link
      IVolume.grantDetachVolumeFromSelf
      to grant an instance permission to detach this volume from itself.

      Specified by:
      grantDetachVolume in interface IVolume
      Parameters:
      grantee - the principal being granted permission. This parameter is required.
      instances - the instances to which permission is being granted to detach this volume from.
    • grantDetachVolumeByResourceTag

      @Stability(Stable) @NotNull default Grant grantDetachVolumeByResourceTag(@NotNull IGrantable grantee, @NotNull List<software.constructs.Construct> constructs, @Nullable String tagKeySuffix)
      Grants permission to detach the Volume by a ResourceTag condition.

      This is implemented via the same mechanism as

      invalid @link
      IVolume.grantAttachVolumeByResourceTag
      , and is subject to the same conditions.

      Specified by:
      grantDetachVolumeByResourceTag in interface IVolume
      Parameters:
      grantee - the principal being granted permission. This parameter is required.
      constructs - The list of constructs that will have the generated resource tag applied to them. This parameter is required.
      tagKeySuffix - A suffix to use on the generated Tag key in place of the generated hash value.