Creates a NAT gateway in the specified public subnet. This action creates a network interface in the specified subnet with a private IP address from the IP address range of the subnet. Internet-bound traffic from a private subnet can be routed to the NAT gateway, therefore enabling instances in the private subnet to connect to the internet. For more information, see NAT Gateways in the Amazon Virtual Private Cloud User Guide.
ec2_create_nat_gateway(AllocationId, ClientToken, DryRun, SubnetId,
TagSpecifications)
A list with the following syntax:
list(
ClientToken = "string",
NatGateway = list(
CreateTime = as.POSIXct(
"2015-01-01"
),
DeleteTime = as.POSIXct(
"2015-01-01"
),
FailureCode = "string",
FailureMessage = "string",
NatGatewayAddresses = list(
list(
AllocationId = "string",
NetworkInterfaceId = "string",
PrivateIp = "string",
PublicIp = "string"
)
),
NatGatewayId = "string",
ProvisionedBandwidth = list(
ProvisionTime = as.POSIXct(
"2015-01-01"
),
Provisioned = "string",
RequestTime = as.POSIXct(
"2015-01-01"
),
Requested = "string",
Status = "string"
),
State = "pending"|"failed"|"available"|"deleting"|"deleted",
SubnetId = "string",
VpcId = "string",
Tags = list(
list(
Key = "string",
Value = "string"
)
)
)
)
[required] The allocation ID of an Elastic IP address to associate with the NAT gateway. If the Elastic IP address is associated with another resource, you must first disassociate it.
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.
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
.
[required] The subnet in which to create the NAT gateway.
The tags to assign to the NAT gateway.
svc$create_nat_gateway(
AllocationId = "string",
ClientToken = "string",
DryRun = TRUE|FALSE,
SubnetId = "string",
TagSpecifications = list(
list(
ResourceType = "client-vpn-endpoint"|"customer-gateway"|"dedicated-host"|"dhcp-options"|"egress-only-internet-gateway"|"elastic-ip"|"elastic-gpu"|"export-image-task"|"export-instance-task"|"fleet"|"fpga-image"|"host-reservation"|"image"|"import-image-task"|"import-snapshot-task"|"instance"|"internet-gateway"|"key-pair"|"launch-template"|"local-gateway-route-table-vpc-association"|"natgateway"|"network-acl"|"network-interface"|"network-insights-analysis"|"network-insights-path"|"placement-group"|"reserved-instances"|"route-table"|"security-group"|"snapshot"|"spot-fleet-request"|"spot-instances-request"|"subnet"|"traffic-mirror-filter"|"traffic-mirror-session"|"traffic-mirror-target"|"transit-gateway"|"transit-gateway-attachment"|"transit-gateway-connect-peer"|"transit-gateway-multicast-domain"|"transit-gateway-route-table"|"volume"|"vpc"|"vpc-peering-connection"|"vpn-connection"|"vpn-gateway"|"vpc-flow-log",
Tags = list(
list(
Key = "string",
Value = "string"
)
)
)
)
)
if (FALSE) {
# This example creates a NAT gateway in subnet subnet-1a2b3c4d and
# associates an Elastic IP address with the allocation ID
# eipalloc-37fc1a52 with the NAT gateway.
svc$create_nat_gateway(
AllocationId = "eipalloc-37fc1a52",
SubnetId = "subnet-1a2b3c4d"
)
}
Run the code above in your browser using DataLab