Class Volume


  • public class Volume
    extends com.pulumi.resources.CustomResource
    Manages a single EBS volume. ## Example Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.ebs.Volume;
     import com.pulumi.aws.ebs.VolumeArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var example = new Volume("example", VolumeArgs.builder()
                 .availabilityZone("us-west-2a")
                 .size(40)
                 .tags(Map.of("Name", "HelloWorld"))
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import EBS Volumes using the `id`. For example: ```sh $ pulumi import aws:ebs/volume:Volume id vol-049df61146c4d7901 ``` ### Identity Schema #### Required * `id` (String) Volume ID. #### Optional * `accountId` (String) AWS Account where this resource is managed. * `region` (String) Region where this resource is managed.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Volume​(java.lang.String name)  
      Volume​(java.lang.String name, VolumeArgs args)  
      Volume​(java.lang.String name, VolumeArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.lang.String> availabilityZone()  
      com.pulumi.core.Output<java.lang.String> createTime()  
      com.pulumi.core.Output<java.lang.Boolean> encrypted()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> finalSnapshot()  
      static Volume get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, VolumeState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.Integer> iops()  
      com.pulumi.core.Output<java.lang.String> kmsKeyId()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> multiAttachEnabled()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> outpostArn()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.lang.Integer> size()  
      com.pulumi.core.Output<java.lang.String> snapshotId()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      com.pulumi.core.Output<java.lang.Integer> throughput()  
      com.pulumi.core.Output<java.lang.String> type()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> volumeInitializationRate()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Volume

        public Volume​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Volume

        public Volume​(java.lang.String name,
                      VolumeArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Volume

        public Volume​(java.lang.String name,
                      VolumeArgs args,
                      @Nullable
                      com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        Volume ARN (e.g., arn:aws:ec2:us-east-1:123456789012:volume/vol-59fcb34e).
      • availabilityZone

        public com.pulumi.core.Output<java.lang.String> availabilityZone()
        Returns:
        Availability zone where the EBS volume will exist.
      • createTime

        public com.pulumi.core.Output<java.lang.String> createTime()
        Returns:
        Timestamp when volume creation was initiated.
      • encrypted

        public com.pulumi.core.Output<java.lang.Boolean> encrypted()
        Returns:
        If true, the disk will be encrypted.
      • finalSnapshot

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> finalSnapshot()
        Returns:
        If true, snapshot will be created before volume deletion. Any tags on the volume will be migrated to the snapshot. By default set to false
      • iops

        public com.pulumi.core.Output<java.lang.Integer> iops()
        Returns:
        Amount of IOPS to provision for the disk. Only valid for `type` of `io1`, `io2` or `gp3`.
      • kmsKeyId

        public com.pulumi.core.Output<java.lang.String> kmsKeyId()
        Returns:
        ARN for the KMS encryption key. When specifying `kmsKeyId`, `encrypted` needs to be set to true. Note: The provider must be running with credentials which have the `GenerateDataKeyWithoutPlaintext` permission on the specified KMS key as required by the [EBS KMS CMK volume provisioning process](https://docs.aws.amazon.com/kms/latest/developerguide/services-ebs.html#ebs-cmk) to prevent a volume from being created and almost immediately deleted.
      • multiAttachEnabled

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> multiAttachEnabled()
        Returns:
        Specifies whether to enable Amazon EBS Multi-Attach. Multi-Attach is supported on `io1` and `io2` volumes.
      • outpostArn

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> outpostArn()
        Returns:
        ARN of the Outpost.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • size

        public com.pulumi.core.Output<java.lang.Integer> size()
        Returns:
        Size of the drive in GiBs.
      • snapshotId

        public com.pulumi.core.Output<java.lang.String> snapshotId()
        Returns:
        A snapshot to base the EBS volume off of.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
      • throughput

        public com.pulumi.core.Output<java.lang.Integer> throughput()
        Returns:
        Throughput that the volume supports, in MiB/s. Only valid for `type` of `gp3`.
      • type

        public com.pulumi.core.Output<java.lang.String> type()
        Returns:
        Type of EBS volume. Can be `standard`, `gp2`, `gp3`, `io1`, `io2`, `sc1` or `st1` (Default: `gp2`).
      • volumeInitializationRate

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> volumeInitializationRate()
        Returns:
        EBS provisioned rate for volume initialization, in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume. This argument can only be set if `snapshotId` is specified. > **NOTE:** At least one of `size` or `snapshotId` is required. > **NOTE:** When changing the `size`, `iops` or `type` of an instance, there are [considerations](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/considerations.html) to be aware of.
      • get

        public static Volume get​(java.lang.String name,
                                 com.pulumi.core.Output<java.lang.String> id,
                                 @Nullable
                                 VolumeState state,
                                 @Nullable
                                 com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.