amazonka-ec2-1.6.1: Amazon Elastic Compute Cloud SDK.

Copyright(c) 2013-2018 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.EC2.DetachVolume

Contents

Description

Detaches an EBS volume from an instance. Make sure to unmount any file systems on the device within your operating system before detaching the volume. Failure to do so can result in the volume becoming stuck in the busy state while detaching. If this happens, detachment can be delayed indefinitely until you unmount the volume, force detachment, reboot the instance, or all three. If an EBS volume is the root device of an instance, it can't be detached while the instance is running. To detach the root volume, stop the instance first.

When a volume with an AWS Marketplace product code is detached from an instance, the product code is no longer associated with the instance.

For more information, see Detaching an Amazon EBS Volume in the Amazon Elastic Compute Cloud User Guide .

Synopsis

Creating a Request

detachVolume Source #

Creates a value of DetachVolume with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • dvInstanceId - The ID of the instance.
  • dvForce - Forces detachment if the previous detachment attempt did not occur cleanly (for example, logging into an instance, unmounting the volume, and detaching normally). This option can lead to data loss or a corrupted file system. Use this option only as a last resort to detach a volume from a failed instance. The instance won't have an opportunity to flush file system caches or file system metadata. If you use this option, you must perform file system check and repair procedures.
  • dvDevice - The device name.
  • dvDryRun - 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 .
  • dvVolumeId - The ID of the volume.

data DetachVolume Source #

Contains the parameters for DetachVolume.

See: detachVolume smart constructor.

Instances
Eq DetachVolume Source # 
Instance details

Defined in Network.AWS.EC2.DetachVolume

Data DetachVolume Source # 
Instance details

Defined in Network.AWS.EC2.DetachVolume

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DetachVolume -> c DetachVolume #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DetachVolume #

toConstr :: DetachVolume -> Constr #

dataTypeOf :: DetachVolume -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DetachVolume) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DetachVolume) #

gmapT :: (forall b. Data b => b -> b) -> DetachVolume -> DetachVolume #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DetachVolume -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DetachVolume -> r #

gmapQ :: (forall d. Data d => d -> u) -> DetachVolume -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DetachVolume -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DetachVolume -> m DetachVolume #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DetachVolume -> m DetachVolume #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DetachVolume -> m DetachVolume #

Read DetachVolume Source # 
Instance details

Defined in Network.AWS.EC2.DetachVolume

Show DetachVolume Source # 
Instance details

Defined in Network.AWS.EC2.DetachVolume

Generic DetachVolume Source # 
Instance details

Defined in Network.AWS.EC2.DetachVolume

Associated Types

type Rep DetachVolume :: Type -> Type #

Hashable DetachVolume Source # 
Instance details

Defined in Network.AWS.EC2.DetachVolume

AWSRequest DetachVolume Source # 
Instance details

Defined in Network.AWS.EC2.DetachVolume

Associated Types

type Rs DetachVolume :: Type #

ToHeaders DetachVolume Source # 
Instance details

Defined in Network.AWS.EC2.DetachVolume

ToPath DetachVolume Source # 
Instance details

Defined in Network.AWS.EC2.DetachVolume

ToQuery DetachVolume Source # 
Instance details

Defined in Network.AWS.EC2.DetachVolume

NFData DetachVolume Source # 
Instance details

Defined in Network.AWS.EC2.DetachVolume

Methods

rnf :: DetachVolume -> () #

type Rep DetachVolume Source # 
Instance details

Defined in Network.AWS.EC2.DetachVolume

type Rep DetachVolume = D1 (MetaData "DetachVolume" "Network.AWS.EC2.DetachVolume" "amazonka-ec2-1.6.1-GgG1M0FWcBrE5I5IM2QktE" False) (C1 (MetaCons "DetachVolume'" PrefixI True) ((S1 (MetaSel (Just "_dvInstanceId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_dvForce") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Bool))) :*: (S1 (MetaSel (Just "_dvDevice") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 (MetaSel (Just "_dvDryRun") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 (MetaSel (Just "_dvVolumeId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)))))
type Rs DetachVolume Source # 
Instance details

Defined in Network.AWS.EC2.DetachVolume

Request Lenses

dvInstanceId :: Lens' DetachVolume (Maybe Text) Source #

The ID of the instance.

dvForce :: Lens' DetachVolume (Maybe Bool) Source #

Forces detachment if the previous detachment attempt did not occur cleanly (for example, logging into an instance, unmounting the volume, and detaching normally). This option can lead to data loss or a corrupted file system. Use this option only as a last resort to detach a volume from a failed instance. The instance won't have an opportunity to flush file system caches or file system metadata. If you use this option, you must perform file system check and repair procedures.

dvDryRun :: Lens' DetachVolume (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 .

dvVolumeId :: Lens' DetachVolume Text Source #

The ID of the volume.

Destructuring the Response

volumeAttachment :: VolumeAttachment Source #

Creates a value of VolumeAttachment with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

data VolumeAttachment Source #

Describes volume attachment details.

See: volumeAttachment smart constructor.

Instances
Eq VolumeAttachment Source # 
Instance details

Defined in Network.AWS.EC2.Types.Product

Data VolumeAttachment Source # 
Instance details

Defined in Network.AWS.EC2.Types.Product

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> VolumeAttachment -> c VolumeAttachment #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c VolumeAttachment #

toConstr :: VolumeAttachment -> Constr #

dataTypeOf :: VolumeAttachment -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c VolumeAttachment) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c VolumeAttachment) #

gmapT :: (forall b. Data b => b -> b) -> VolumeAttachment -> VolumeAttachment #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> VolumeAttachment -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> VolumeAttachment -> r #

gmapQ :: (forall d. Data d => d -> u) -> VolumeAttachment -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> VolumeAttachment -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> VolumeAttachment -> m VolumeAttachment #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> VolumeAttachment -> m VolumeAttachment #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> VolumeAttachment -> m VolumeAttachment #

Read VolumeAttachment Source # 
Instance details

Defined in Network.AWS.EC2.Types.Product

Show VolumeAttachment Source # 
Instance details

Defined in Network.AWS.EC2.Types.Product

Generic VolumeAttachment Source # 
Instance details

Defined in Network.AWS.EC2.Types.Product

Associated Types

type Rep VolumeAttachment :: Type -> Type #

Hashable VolumeAttachment Source # 
Instance details

Defined in Network.AWS.EC2.Types.Product

FromXML VolumeAttachment Source # 
Instance details

Defined in Network.AWS.EC2.Types.Product

NFData VolumeAttachment Source # 
Instance details

Defined in Network.AWS.EC2.Types.Product

Methods

rnf :: VolumeAttachment -> () #

type Rep VolumeAttachment Source # 
Instance details

Defined in Network.AWS.EC2.Types.Product

type Rep VolumeAttachment = D1 (MetaData "VolumeAttachment" "Network.AWS.EC2.Types.Product" "amazonka-ec2-1.6.1-GgG1M0FWcBrE5I5IM2QktE" False) (C1 (MetaCons "VolumeAttachment'" PrefixI True) ((S1 (MetaSel (Just "_volInstanceId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 (MetaSel (Just "_volDeleteOnTermination") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 (MetaSel (Just "_volState") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe VolumeAttachmentState)))) :*: (S1 (MetaSel (Just "_volDevice") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 (MetaSel (Just "_volVolumeId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_volAttachTime") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe ISO8601))))))

Response Lenses

volInstanceId :: Lens' VolumeAttachment (Maybe Text) Source #

The ID of the instance.

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

Indicates whether the EBS volume is deleted on instance termination.

volState :: Lens' VolumeAttachment (Maybe VolumeAttachmentState) Source #

The attachment state of the volume.

volVolumeId :: Lens' VolumeAttachment (Maybe Text) Source #

The ID of the volume.

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

The time stamp when the attachment initiated.