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.AssociateAddress

Contents

Description

Associates an Elastic IP address with an instance or a network interface.

An Elastic IP address is for use in either the EC2-Classic platform or in a VPC. For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide .

EC2-Classic, VPC in an EC2-VPC-only account
If the Elastic IP address is already associated with a different instance, it is disassociated from that instance and associated with the specified instance. If you associate an Elastic IP address with an instance that has an existing Elastic IP address, the existing address is disassociated from the instance, but remains allocated to your account.
VPC in an EC2-Classic account
If you don't specify a private IP address, the Elastic IP address is associated with the primary IP address. If the Elastic IP address is already associated with a different instance or a network interface, you get an error unless you allow reassociation. You cannot associate an Elastic IP address with an instance or network interface that has an existing Elastic IP address.

Important: This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error, and you may be charged for each time the Elastic IP address is remapped to the same instance. For more information, see the Elastic IP Addresses section of Amazon EC2 Pricing .

Synopsis

Creating a Request

associateAddress :: AssociateAddress Source #

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

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

  • aasInstanceId - The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you can specify either the instance ID or the network interface ID, but not both. The operation fails if you specify an instance ID unless exactly one network interface is attached.
  • aasAllocationId - [EC2-VPC] The allocation ID. This is required for EC2-VPC.
  • aasNetworkInterfaceId - [EC2-VPC] The ID of the network interface. If the instance has more than one network interface, you must specify a network interface ID.
  • aasAllowReassociation - [EC2-VPC] For a VPC in an EC2-Classic account, specify true to allow an Elastic IP address that is already associated with an instance or network interface to be reassociated with the specified instance or network interface. Otherwise, the operation fails. In a VPC in an EC2-VPC-only account, reassociation is automatic, therefore you can specify false to ensure the operation fails if the Elastic IP address is already associated with another resource.
  • aasPrivateIPAddress - [EC2-VPC] The primary or secondary private IP address to associate with the Elastic IP address. If no private IP address is specified, the Elastic IP address is associated with the primary private IP address.
  • aasPublicIP - The Elastic IP address. This is required for EC2-Classic.
  • aasDryRun - 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 .

data AssociateAddress Source #

Contains the parameters for AssociateAddress.

See: associateAddress smart constructor.

Instances
Eq AssociateAddress Source # 
Instance details

Defined in Network.AWS.EC2.AssociateAddress

Data AssociateAddress Source # 
Instance details

Defined in Network.AWS.EC2.AssociateAddress

Methods

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

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

toConstr :: AssociateAddress -> Constr #

dataTypeOf :: AssociateAddress -> DataType #

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

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

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

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

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

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

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

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

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

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

Read AssociateAddress Source # 
Instance details

Defined in Network.AWS.EC2.AssociateAddress

Show AssociateAddress Source # 
Instance details

Defined in Network.AWS.EC2.AssociateAddress

Generic AssociateAddress Source # 
Instance details

Defined in Network.AWS.EC2.AssociateAddress

Associated Types

type Rep AssociateAddress :: Type -> Type #

Hashable AssociateAddress Source # 
Instance details

Defined in Network.AWS.EC2.AssociateAddress

AWSRequest AssociateAddress Source # 
Instance details

Defined in Network.AWS.EC2.AssociateAddress

Associated Types

type Rs AssociateAddress :: Type #

ToHeaders AssociateAddress Source # 
Instance details

Defined in Network.AWS.EC2.AssociateAddress

ToPath AssociateAddress Source # 
Instance details

Defined in Network.AWS.EC2.AssociateAddress

ToQuery AssociateAddress Source # 
Instance details

Defined in Network.AWS.EC2.AssociateAddress

NFData AssociateAddress Source # 
Instance details

Defined in Network.AWS.EC2.AssociateAddress

Methods

rnf :: AssociateAddress -> () #

type Rep AssociateAddress Source # 
Instance details

Defined in Network.AWS.EC2.AssociateAddress

type Rep AssociateAddress = D1 (MetaData "AssociateAddress" "Network.AWS.EC2.AssociateAddress" "amazonka-ec2-1.6.1-GgG1M0FWcBrE5I5IM2QktE" False) (C1 (MetaCons "AssociateAddress'" PrefixI True) ((S1 (MetaSel (Just "_aasInstanceId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 (MetaSel (Just "_aasAllocationId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_aasNetworkInterfaceId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 (MetaSel (Just "_aasAllowReassociation") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 (MetaSel (Just "_aasPrivateIPAddress") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 (MetaSel (Just "_aasPublicIP") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_aasDryRun") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Bool))))))
type Rs AssociateAddress Source # 
Instance details

Defined in Network.AWS.EC2.AssociateAddress

Request Lenses

aasInstanceId :: Lens' AssociateAddress (Maybe Text) Source #

The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you can specify either the instance ID or the network interface ID, but not both. The operation fails if you specify an instance ID unless exactly one network interface is attached.

aasAllocationId :: Lens' AssociateAddress (Maybe Text) Source #

EC2-VPC
The allocation ID. This is required for EC2-VPC.

aasNetworkInterfaceId :: Lens' AssociateAddress (Maybe Text) Source #

EC2-VPC
The ID of the network interface. If the instance has more than one network interface, you must specify a network interface ID.

aasAllowReassociation :: Lens' AssociateAddress (Maybe Bool) Source #

EC2-VPC
For a VPC in an EC2-Classic account, specify true to allow an Elastic IP address that is already associated with an instance or network interface to be reassociated with the specified instance or network interface. Otherwise, the operation fails. In a VPC in an EC2-VPC-only account, reassociation is automatic, therefore you can specify false to ensure the operation fails if the Elastic IP address is already associated with another resource.

aasPrivateIPAddress :: Lens' AssociateAddress (Maybe Text) Source #

EC2-VPC
The primary or secondary private IP address to associate with the Elastic IP address. If no private IP address is specified, the Elastic IP address is associated with the primary private IP address.

aasPublicIP :: Lens' AssociateAddress (Maybe Text) Source #

The Elastic IP address. This is required for EC2-Classic.

aasDryRun :: Lens' AssociateAddress (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 .

Destructuring the Response

associateAddressResponse Source #

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

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

data AssociateAddressResponse Source #

Contains the output of AssociateAddress.

See: associateAddressResponse smart constructor.

Instances
Eq AssociateAddressResponse Source # 
Instance details

Defined in Network.AWS.EC2.AssociateAddress

Data AssociateAddressResponse Source # 
Instance details

Defined in Network.AWS.EC2.AssociateAddress

Methods

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

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

toConstr :: AssociateAddressResponse -> Constr #

dataTypeOf :: AssociateAddressResponse -> DataType #

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

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

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

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

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

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

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

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

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

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

Read AssociateAddressResponse Source # 
Instance details

Defined in Network.AWS.EC2.AssociateAddress

Show AssociateAddressResponse Source # 
Instance details

Defined in Network.AWS.EC2.AssociateAddress

Generic AssociateAddressResponse Source # 
Instance details

Defined in Network.AWS.EC2.AssociateAddress

Associated Types

type Rep AssociateAddressResponse :: Type -> Type #

NFData AssociateAddressResponse Source # 
Instance details

Defined in Network.AWS.EC2.AssociateAddress

type Rep AssociateAddressResponse Source # 
Instance details

Defined in Network.AWS.EC2.AssociateAddress

type Rep AssociateAddressResponse = D1 (MetaData "AssociateAddressResponse" "Network.AWS.EC2.AssociateAddress" "amazonka-ec2-1.6.1-GgG1M0FWcBrE5I5IM2QktE" False) (C1 (MetaCons "AssociateAddressResponse'" PrefixI True) (S1 (MetaSel (Just "_arsAssociationId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_arsResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int)))

Response Lenses

arsAssociationId :: Lens' AssociateAddressResponse (Maybe Text) Source #

EC2-VPC
The ID that represents the association of the Elastic IP address with an instance.