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

Description

Creates a NAT gateway in the specified subnet. This action creates a network interface in the specified subnet with a private IP address from the IP address range of the subnet. You can create either a public NAT gateway or a private NAT gateway.

With a public NAT gateway, internet-bound traffic from a private subnet can be routed to the NAT gateway, so that instances in a private subnet can connect to the internet.

With a private NAT gateway, private communication is routed across VPCs and on-premises networks through a transit gateway or virtual private gateway. Common use cases include running large workloads behind a small pool of allowlisted IPv4 addresses, preserving private IPv4 addresses, and communicating between overlapping networks.

For more information, see NAT gateways in the Amazon Virtual Private Cloud User Guide.

Synopsis

Creating a Request

data CreateNatGateway Source #

See: newCreateNatGateway smart constructor.

Constructors

CreateNatGateway' 

Fields

  • allocationId :: Maybe Text
    Public NAT gateways only
    The allocation ID of an Elastic IP address to associate with the NAT gateway. You cannot specify an Elastic IP address with a private NAT gateway. If the Elastic IP address is associated with another resource, you must first disassociate it.
  • clientToken :: Maybe Text

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to ensure idempotency.

    Constraint: Maximum 64 ASCII characters.

  • connectivityType :: Maybe ConnectivityType

    Indicates whether the NAT gateway supports public or private connectivity. The default is public connectivity.

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

  • privateIpAddress :: Maybe Text

    The private IPv4 address to assign to the NAT gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.

  • tagSpecifications :: Maybe [TagSpecification]

    The tags to assign to the NAT gateway.

  • subnetId :: Text

    The subnet in which to create the NAT gateway.

Instances

Instances details
ToHeaders CreateNatGateway Source # 
Instance details

Defined in Amazonka.EC2.CreateNatGateway

ToPath CreateNatGateway Source # 
Instance details

Defined in Amazonka.EC2.CreateNatGateway

ToQuery CreateNatGateway Source # 
Instance details

Defined in Amazonka.EC2.CreateNatGateway

AWSRequest CreateNatGateway Source # 
Instance details

Defined in Amazonka.EC2.CreateNatGateway

Associated Types

type AWSResponse CreateNatGateway #

Generic CreateNatGateway Source # 
Instance details

Defined in Amazonka.EC2.CreateNatGateway

Associated Types

type Rep CreateNatGateway :: Type -> Type #

Read CreateNatGateway Source # 
Instance details

Defined in Amazonka.EC2.CreateNatGateway

Show CreateNatGateway Source # 
Instance details

Defined in Amazonka.EC2.CreateNatGateway

NFData CreateNatGateway Source # 
Instance details

Defined in Amazonka.EC2.CreateNatGateway

Methods

rnf :: CreateNatGateway -> () #

Eq CreateNatGateway Source # 
Instance details

Defined in Amazonka.EC2.CreateNatGateway

Hashable CreateNatGateway Source # 
Instance details

Defined in Amazonka.EC2.CreateNatGateway

type AWSResponse CreateNatGateway Source # 
Instance details

Defined in Amazonka.EC2.CreateNatGateway

type Rep CreateNatGateway Source # 
Instance details

Defined in Amazonka.EC2.CreateNatGateway

newCreateNatGateway Source #

Create a value of CreateNatGateway 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:

CreateNatGateway, createNatGateway_allocationId - [Public NAT gateways only] The allocation ID of an Elastic IP address to associate with the NAT gateway. You cannot specify an Elastic IP address with a private NAT gateway. If the Elastic IP address is associated with another resource, you must first disassociate it.

CreateNatGateway, createNatGateway_clientToken - Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to ensure idempotency.

Constraint: Maximum 64 ASCII characters.

CreateNatGateway, createNatGateway_connectivityType - Indicates whether the NAT gateway supports public or private connectivity. The default is public connectivity.

$sel:dryRun:CreateNatGateway', createNatGateway_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.

CreateNatGateway, createNatGateway_privateIpAddress - The private IPv4 address to assign to the NAT gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.

CreateNatGateway, createNatGateway_tagSpecifications - The tags to assign to the NAT gateway.

CreateNatGateway, createNatGateway_subnetId - The subnet in which to create the NAT gateway.

Request Lenses

createNatGateway_allocationId :: Lens' CreateNatGateway (Maybe Text) Source #

Public NAT gateways only
The allocation ID of an Elastic IP address to associate with the NAT gateway. You cannot specify an Elastic IP address with a private NAT gateway. If the Elastic IP address is associated with another resource, you must first disassociate it.

createNatGateway_clientToken :: Lens' CreateNatGateway (Maybe Text) Source #

Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to ensure idempotency.

Constraint: Maximum 64 ASCII characters.

createNatGateway_connectivityType :: Lens' CreateNatGateway (Maybe ConnectivityType) Source #

Indicates whether the NAT gateway supports public or private connectivity. The default is public connectivity.

createNatGateway_dryRun :: Lens' CreateNatGateway (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.

createNatGateway_privateIpAddress :: Lens' CreateNatGateway (Maybe Text) Source #

The private IPv4 address to assign to the NAT gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.

createNatGateway_subnetId :: Lens' CreateNatGateway Text Source #

The subnet in which to create the NAT gateway.

Destructuring the Response

data CreateNatGatewayResponse Source #

See: newCreateNatGatewayResponse smart constructor.

Constructors

CreateNatGatewayResponse' 

Fields

Instances

Instances details
Generic CreateNatGatewayResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateNatGateway

Associated Types

type Rep CreateNatGatewayResponse :: Type -> Type #

Read CreateNatGatewayResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateNatGateway

Show CreateNatGatewayResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateNatGateway

NFData CreateNatGatewayResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateNatGateway

Eq CreateNatGatewayResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateNatGateway

type Rep CreateNatGatewayResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateNatGateway

type Rep CreateNatGatewayResponse = D1 ('MetaData "CreateNatGatewayResponse" "Amazonka.EC2.CreateNatGateway" "amazonka-ec2-2.0-48L9RAJvmvzAdBkRegqWCL" 'False) (C1 ('MetaCons "CreateNatGatewayResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "clientToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "natGateway") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe NatGateway)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

newCreateNatGatewayResponse Source #

Create a value of CreateNatGatewayResponse 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:

CreateNatGateway, createNatGatewayResponse_clientToken - Unique, case-sensitive identifier to ensure the idempotency of the request. Only returned if a client token was provided in the request.

CreateNatGatewayResponse, createNatGatewayResponse_natGateway - Information about the NAT gateway.

$sel:httpStatus:CreateNatGatewayResponse', createNatGatewayResponse_httpStatus - The response's http status code.

Response Lenses

createNatGatewayResponse_clientToken :: Lens' CreateNatGatewayResponse (Maybe Text) Source #

Unique, case-sensitive identifier to ensure the idempotency of the request. Only returned if a client token was provided in the request.