NatGateway

Provides a resource to create a VPC NAT Gateway.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var gw = new Aws.Ec2.NatGateway("gw", new Aws.Ec2.NatGatewayArgs
        {
            AllocationId = aws_eip.Nat.Id,
            SubnetId = aws_subnet.Example.Id,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := ec2.NewNatGateway(ctx, "gw", &ec2.NatGatewayArgs{
            AllocationId: pulumi.String(aws_eip.Nat.Id),
            SubnetId:     pulumi.String(aws_subnet.Example.Id),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

gw = aws.ec2.NatGateway("gw",
    allocation_id=aws_eip["nat"]["id"],
    subnet_id=aws_subnet["example"]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const gw = new aws.ec2.NatGateway("gw", {
    allocationId: aws_eip_nat.id,
    subnetId: aws_subnet_example.id,
});

Create a NatGateway Resource

def NatGateway(resource_name, opts=None, allocation_id=None, subnet_id=None, tags=None, __props__=None)
func NewNatGateway(ctx *Context, name string, args NatGatewayArgs, opts ...ResourceOption) (*NatGateway, error)
public NatGateway(string name, NatGatewayArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args NatGatewayArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args NatGatewayArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args NatGatewayArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

NatGateway Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The NatGateway resource accepts the following input properties:

AllocationId string

The Allocation ID of the Elastic IP address for the gateway.

SubnetId string

The Subnet ID of the subnet in which to place the gateway.

Tags Dictionary<string, string>

A map of tags to assign to the resource.

AllocationId string

The Allocation ID of the Elastic IP address for the gateway.

SubnetId string

The Subnet ID of the subnet in which to place the gateway.

Tags map[string]string

A map of tags to assign to the resource.

allocationId string

The Allocation ID of the Elastic IP address for the gateway.

subnetId string

The Subnet ID of the subnet in which to place the gateway.

tags {[key: string]: string}

A map of tags to assign to the resource.

allocation_id str

The Allocation ID of the Elastic IP address for the gateway.

subnet_id str

The Subnet ID of the subnet in which to place the gateway.

tags Dict[str, str]

A map of tags to assign to the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the NatGateway resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
NetworkInterfaceId string

The ENI ID of the network interface created by the NAT gateway.

PrivateIp string

The private IP address of the NAT Gateway.

PublicIp string

The public IP address of the NAT Gateway.

Id string
The provider-assigned unique ID for this managed resource.
NetworkInterfaceId string

The ENI ID of the network interface created by the NAT gateway.

PrivateIp string

The private IP address of the NAT Gateway.

PublicIp string

The public IP address of the NAT Gateway.

id string
The provider-assigned unique ID for this managed resource.
networkInterfaceId string

The ENI ID of the network interface created by the NAT gateway.

privateIp string

The private IP address of the NAT Gateway.

publicIp string

The public IP address of the NAT Gateway.

id str
The provider-assigned unique ID for this managed resource.
network_interface_id str

The ENI ID of the network interface created by the NAT gateway.

private_ip str

The private IP address of the NAT Gateway.

public_ip str

The public IP address of the NAT Gateway.

Look up an Existing NatGateway Resource

Get an existing NatGateway resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: NatGatewayState, opts?: CustomResourceOptions): NatGateway
static get(resource_name, id, opts=None, allocation_id=None, network_interface_id=None, private_ip=None, public_ip=None, subnet_id=None, tags=None, __props__=None)
func GetNatGateway(ctx *Context, name string, id IDInput, state *NatGatewayState, opts ...ResourceOption) (*NatGateway, error)
public static NatGateway Get(string name, Input<string> id, NatGatewayState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

AllocationId string

The Allocation ID of the Elastic IP address for the gateway.

NetworkInterfaceId string

The ENI ID of the network interface created by the NAT gateway.

PrivateIp string

The private IP address of the NAT Gateway.

PublicIp string

The public IP address of the NAT Gateway.

SubnetId string

The Subnet ID of the subnet in which to place the gateway.

Tags Dictionary<string, string>

A map of tags to assign to the resource.

AllocationId string

The Allocation ID of the Elastic IP address for the gateway.

NetworkInterfaceId string

The ENI ID of the network interface created by the NAT gateway.

PrivateIp string

The private IP address of the NAT Gateway.

PublicIp string

The public IP address of the NAT Gateway.

SubnetId string

The Subnet ID of the subnet in which to place the gateway.

Tags map[string]string

A map of tags to assign to the resource.

allocationId string

The Allocation ID of the Elastic IP address for the gateway.

networkInterfaceId string

The ENI ID of the network interface created by the NAT gateway.

privateIp string

The private IP address of the NAT Gateway.

publicIp string

The public IP address of the NAT Gateway.

subnetId string

The Subnet ID of the subnet in which to place the gateway.

tags {[key: string]: string}

A map of tags to assign to the resource.

allocation_id str

The Allocation ID of the Elastic IP address for the gateway.

network_interface_id str

The ENI ID of the network interface created by the NAT gateway.

private_ip str

The private IP address of the NAT Gateway.

public_ip str

The public IP address of the NAT Gateway.

subnet_id str

The Subnet ID of the subnet in which to place the gateway.

tags Dict[str, str]

A map of tags to assign to the resource.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.