Expand description
Provides a resource to create a VPC NAT Gateway.
§Example Usage
§Public NAT
resources:
example:
type: aws:ec2:NatGateway
properties:
allocationId: ${exampleAwsEip.id}
subnetId: ${exampleAwsSubnet.id}
tags:
Name: gw NAT
options:
dependsOn:
- ${exampleAwsInternetGateway}
§Public NAT with Secondary Private IP Addresses
ⓘ
use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
let example = nat_gateway::create(
"example",
NatGatewayArgs::builder()
.allocation_id("${exampleAwsEip.id}")
.secondary_allocation_ids(vec!["${secondary.id}",])
.secondary_private_ip_addresses(vec!["10.0.1.5",])
.subnet_id("${exampleAwsSubnet.id}")
.build_struct(),
);
}
§Private NAT
ⓘ
use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
let example = nat_gateway::create(
"example",
NatGatewayArgs::builder()
.connectivity_type("private")
.subnet_id("${exampleAwsSubnet.id}")
.build_struct(),
);
}
§Private NAT with Secondary Private IP Addresses
ⓘ
use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
let example = nat_gateway::create(
"example",
NatGatewayArgs::builder()
.connectivity_type("private")
.secondary_private_ip_address_count(7)
.subnet_id("${exampleAwsSubnet.id}")
.build_struct(),
);
}
§Import
Using pulumi import
, import NAT Gateways using the id
. For example:
$ pulumi import aws:ec2/natGateway:NatGateway private_gw nat-05dba92075d71c408
Structs§
- Use builder syntax to set the inputs and finish with
build_struct()
.
Functions§
- Registers a new resource with the given unique name and arguments