amazonka-ec2-2.0: Amazon Elastic Compute Cloud SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.EC2.AttachVolume

Description

Attaches an EBS volume to a running or stopped instance and exposes it to the instance with the specified device name.

Encrypted EBS volumes must be attached to instances that support Amazon EBS encryption. For more information, see Amazon EBS encryption in the Amazon Elastic Compute Cloud User Guide.

After you attach an EBS volume, you must make it available. For more information, see Make an EBS volume available for use.

If a volume has an Amazon Web Services Marketplace product code:

  • The volume can be attached only to a stopped instance.
  • Amazon Web Services Marketplace product codes are copied from the volume to the instance.
  • You must be subscribed to the product.
  • The instance type and operating system of the instance must support the product. For example, you can't detach a volume from a Windows instance and attach it to a Linux instance.

For more information, see Attach an Amazon EBS volume to an instance in the Amazon Elastic Compute Cloud User Guide.

Synopsis

Creating a Request

data AttachVolume Source #

See: newAttachVolume smart constructor.

Constructors

AttachVolume' 

Fields

  • dryRun :: Maybe Bool

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • device :: Text

    The device name (for example, /dev/sdh or xvdh).

  • instanceId :: Text

    The ID of the instance.

  • volumeId :: Text

    The ID of the EBS volume. The volume and instance must be within the same Availability Zone.

Instances

Instances details
ToHeaders AttachVolume Source # 
Instance details

Defined in Amazonka.EC2.AttachVolume

ToPath AttachVolume Source # 
Instance details

Defined in Amazonka.EC2.AttachVolume

ToQuery AttachVolume Source # 
Instance details

Defined in Amazonka.EC2.AttachVolume

AWSRequest AttachVolume Source # 
Instance details

Defined in Amazonka.EC2.AttachVolume

Associated Types

type AWSResponse AttachVolume #

Generic AttachVolume Source # 
Instance details

Defined in Amazonka.EC2.AttachVolume

Associated Types

type Rep AttachVolume :: Type -> Type #

Read AttachVolume Source # 
Instance details

Defined in Amazonka.EC2.AttachVolume

Show AttachVolume Source # 
Instance details

Defined in Amazonka.EC2.AttachVolume

NFData AttachVolume Source # 
Instance details

Defined in Amazonka.EC2.AttachVolume

Methods

rnf :: AttachVolume -> () #

Eq AttachVolume Source # 
Instance details

Defined in Amazonka.EC2.AttachVolume

Hashable AttachVolume Source # 
Instance details

Defined in Amazonka.EC2.AttachVolume

type AWSResponse AttachVolume Source # 
Instance details

Defined in Amazonka.EC2.AttachVolume

type Rep AttachVolume Source # 
Instance details

Defined in Amazonka.EC2.AttachVolume

type Rep AttachVolume = D1 ('MetaData "AttachVolume" "Amazonka.EC2.AttachVolume" "amazonka-ec2-2.0-48L9RAJvmvzAdBkRegqWCL" 'False) (C1 ('MetaCons "AttachVolume'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "dryRun") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "device") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "instanceId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "volumeId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))

newAttachVolume Source #

Create a value of AttachVolume with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:dryRun:AttachVolume', attachVolume_dryRun - Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

AttachVolume, attachVolume_device - The device name (for example, /dev/sdh or xvdh).

AttachVolume, attachVolume_instanceId - The ID of the instance.

AttachVolume, attachVolume_volumeId - The ID of the EBS volume. The volume and instance must be within the same Availability Zone.

Request Lenses

attachVolume_dryRun :: Lens' AttachVolume (Maybe Bool) Source #

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

attachVolume_device :: Lens' AttachVolume Text Source #

The device name (for example, /dev/sdh or xvdh).

attachVolume_volumeId :: Lens' AttachVolume Text Source #

The ID of the EBS volume. The volume and instance must be within the same Availability Zone.

Destructuring the Response

data VolumeAttachment Source #

Describes volume attachment details.

See: newVolumeAttachment smart constructor.

Constructors

VolumeAttachment' 

Fields

Instances

Instances details
FromXML VolumeAttachment Source # 
Instance details

Defined in Amazonka.EC2.Types.VolumeAttachment

Generic VolumeAttachment Source # 
Instance details

Defined in Amazonka.EC2.Types.VolumeAttachment

Associated Types

type Rep VolumeAttachment :: Type -> Type #

Read VolumeAttachment Source # 
Instance details

Defined in Amazonka.EC2.Types.VolumeAttachment

Show VolumeAttachment Source # 
Instance details

Defined in Amazonka.EC2.Types.VolumeAttachment

NFData VolumeAttachment Source # 
Instance details

Defined in Amazonka.EC2.Types.VolumeAttachment

Methods

rnf :: VolumeAttachment -> () #

Eq VolumeAttachment Source # 
Instance details

Defined in Amazonka.EC2.Types.VolumeAttachment

Hashable VolumeAttachment Source # 
Instance details

Defined in Amazonka.EC2.Types.VolumeAttachment

type Rep VolumeAttachment Source # 
Instance details

Defined in Amazonka.EC2.Types.VolumeAttachment

type Rep VolumeAttachment = D1 ('MetaData "VolumeAttachment" "Amazonka.EC2.Types.VolumeAttachment" "amazonka-ec2-2.0-48L9RAJvmvzAdBkRegqWCL" 'False) (C1 ('MetaCons "VolumeAttachment'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "attachTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ISO8601)) :*: (S1 ('MetaSel ('Just "deleteOnTermination") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "device") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: (S1 ('MetaSel ('Just "instanceId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "state") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe VolumeAttachmentState)) :*: S1 ('MetaSel ('Just "volumeId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))))))

newVolumeAttachment :: VolumeAttachment Source #

Create a value of VolumeAttachment with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:attachTime:VolumeAttachment', volumeAttachment_attachTime - The time stamp when the attachment initiated.

$sel:deleteOnTermination:VolumeAttachment', volumeAttachment_deleteOnTermination - Indicates whether the EBS volume is deleted on instance termination.

$sel:device:VolumeAttachment', volumeAttachment_device - The device name.

$sel:instanceId:VolumeAttachment', volumeAttachment_instanceId - The ID of the instance.

$sel:state:VolumeAttachment', volumeAttachment_state - The attachment state of the volume.

$sel:volumeId:VolumeAttachment', volumeAttachment_volumeId - The ID of the volume.

Response Lenses

volumeAttachment_attachTime :: Lens' VolumeAttachment (Maybe UTCTime) Source #

The time stamp when the attachment initiated.

volumeAttachment_deleteOnTermination :: Lens' VolumeAttachment (Maybe Bool) Source #

Indicates whether the EBS volume is deleted on instance termination.