published on Wednesday, Mar 25, 2026 by Pulumi
published on Wednesday, Mar 25, 2026 by Pulumi
Get information on a VPC NAT Gateway for use with other managed resources This datasource provides all the VPC NAT Gateway properties as configured on the DigitalOcean account. This is useful if the VPC NAT Gateway in question is not managed by Terraform, or any of the relevant data would need to be referenced in other managed resources.
NOTE: VPC NAT Gateway is currently in Private Preview.
Example Usage
Get the VPC NAT Gateway by name:
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const my_imported_vpc_nat_gateway = digitalocean.getVpcNatGateway({
name: my_existing_vpc_nat_gateway.name,
});
import pulumi
import pulumi_digitalocean as digitalocean
my_imported_vpc_nat_gateway = digitalocean.get_vpc_nat_gateway(name=my_existing_vpc_nat_gateway["name"])
package main
import (
"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := digitalocean.LookupVpcNatGateway(ctx, &digitalocean.LookupVpcNatGatewayArgs{
Name: pulumi.StringRef(my_existing_vpc_nat_gateway.Name),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
return await Deployment.RunAsync(() =>
{
var my_imported_vpc_nat_gateway = DigitalOcean.GetVpcNatGateway.Invoke(new()
{
Name = my_existing_vpc_nat_gateway.Name,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DigitaloceanFunctions;
import com.pulumi.digitalocean.inputs.GetVpcNatGatewayArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var my-imported-vpc-nat-gateway = DigitaloceanFunctions.getVpcNatGateway(GetVpcNatGatewayArgs.builder()
.name(my_existing_vpc_nat_gateway.name())
.build());
}
}
variables:
my-imported-vpc-nat-gateway:
fn::invoke:
function: digitalocean:getVpcNatGateway
arguments:
name: ${["my-existing-vpc-nat-gateway"].name}
Get the VPC NAT Gateway by ID:
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const my_imported_vpc_nat_gateway = digitalocean.getVpcNatGateway({
id: my_existing_vpc_nat_gateway.id,
});
import pulumi
import pulumi_digitalocean as digitalocean
my_imported_vpc_nat_gateway = digitalocean.get_vpc_nat_gateway(id=my_existing_vpc_nat_gateway["id"])
package main
import (
"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := digitalocean.LookupVpcNatGateway(ctx, &digitalocean.LookupVpcNatGatewayArgs{
Id: pulumi.StringRef(my_existing_vpc_nat_gateway.Id),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
return await Deployment.RunAsync(() =>
{
var my_imported_vpc_nat_gateway = DigitalOcean.GetVpcNatGateway.Invoke(new()
{
Id = my_existing_vpc_nat_gateway.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DigitaloceanFunctions;
import com.pulumi.digitalocean.inputs.GetVpcNatGatewayArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var my-imported-vpc-nat-gateway = DigitaloceanFunctions.getVpcNatGateway(GetVpcNatGatewayArgs.builder()
.id(my_existing_vpc_nat_gateway.id())
.build());
}
}
variables:
my-imported-vpc-nat-gateway:
fn::invoke:
function: digitalocean:getVpcNatGateway
arguments:
id: ${["my-existing-vpc-nat-gateway"].id}
Using getVpcNatGateway
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getVpcNatGateway(args: GetVpcNatGatewayArgs, opts?: InvokeOptions): Promise<GetVpcNatGatewayResult>
function getVpcNatGatewayOutput(args: GetVpcNatGatewayOutputArgs, opts?: InvokeOptions): Output<GetVpcNatGatewayResult>def get_vpc_nat_gateway(id: Optional[str] = None,
name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetVpcNatGatewayResult
def get_vpc_nat_gateway_output(id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVpcNatGatewayResult]func LookupVpcNatGateway(ctx *Context, args *LookupVpcNatGatewayArgs, opts ...InvokeOption) (*LookupVpcNatGatewayResult, error)
func LookupVpcNatGatewayOutput(ctx *Context, args *LookupVpcNatGatewayOutputArgs, opts ...InvokeOption) LookupVpcNatGatewayResultOutput> Note: This function is named LookupVpcNatGateway in the Go SDK.
public static class GetVpcNatGateway
{
public static Task<GetVpcNatGatewayResult> InvokeAsync(GetVpcNatGatewayArgs args, InvokeOptions? opts = null)
public static Output<GetVpcNatGatewayResult> Invoke(GetVpcNatGatewayInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetVpcNatGatewayResult> getVpcNatGateway(GetVpcNatGatewayArgs args, InvokeOptions options)
public static Output<GetVpcNatGatewayResult> getVpcNatGateway(GetVpcNatGatewayArgs args, InvokeOptions options)
fn::invoke:
function: digitalocean:index/getVpcNatGateway:getVpcNatGateway
arguments:
# arguments dictionaryThe following arguments are supported:
getVpcNatGateway Result
The following output properties are available:
- Created
At string - Egresses
List<Pulumi.
Digital Ocean. Outputs. Get Vpc Nat Gateway Egress> - Icmp
Timeout intSeconds - Project
Id string - Region string
- Size int
- State string
- Tcp
Timeout intSeconds - Type string
- Udp
Timeout intSeconds - Updated
At string - Vpcs
List<Pulumi.
Digital Ocean. Outputs. Get Vpc Nat Gateway Vpc> - Id string
- Name string
- Created
At string - Egresses
[]Get
Vpc Nat Gateway Egress - Icmp
Timeout intSeconds - Project
Id string - Region string
- Size int
- State string
- Tcp
Timeout intSeconds - Type string
- Udp
Timeout intSeconds - Updated
At string - Vpcs
[]Get
Vpc Nat Gateway Vpc - Id string
- Name string
- created
At String - egresses
List<Get
Vpc Nat Gateway Egress> - icmp
Timeout IntegerSeconds - project
Id String - region String
- size Integer
- state String
- tcp
Timeout IntegerSeconds - type String
- udp
Timeout IntegerSeconds - updated
At String - vpcs
List<Get
Vpc Nat Gateway Vpc> - id String
- name String
- created
At string - egresses
Get
Vpc Nat Gateway Egress[] - icmp
Timeout numberSeconds - project
Id string - region string
- size number
- state string
- tcp
Timeout numberSeconds - type string
- udp
Timeout numberSeconds - updated
At string - vpcs
Get
Vpc Nat Gateway Vpc[] - id string
- name string
- created_
at str - egresses
Sequence[Get
Vpc Nat Gateway Egress] - icmp_
timeout_ intseconds - project_
id str - region str
- size int
- state str
- tcp_
timeout_ intseconds - type str
- udp_
timeout_ intseconds - updated_
at str - vpcs
Sequence[Get
Vpc Nat Gateway Vpc] - id str
- name str
- created
At String - egresses List<Property Map>
- icmp
Timeout NumberSeconds - project
Id String - region String
- size Number
- state String
- tcp
Timeout NumberSeconds - type String
- udp
Timeout NumberSeconds - updated
At String - vpcs List<Property Map>
- id String
- name String
Supporting Types
GetVpcNatGatewayEgress
- Public
Gateways List<Pulumi.Digital Ocean. Inputs. Get Vpc Nat Gateway Egress Public Gateway> - List of public gateway IPs
- Public
Gateways []GetVpc Nat Gateway Egress Public Gateway - List of public gateway IPs
- public
Gateways List<GetVpc Nat Gateway Egress Public Gateway> - List of public gateway IPs
- public
Gateways GetVpc Nat Gateway Egress Public Gateway[] - List of public gateway IPs
- public_
gateways Sequence[GetVpc Nat Gateway Egress Public Gateway] - List of public gateway IPs
- public
Gateways List<Property Map> - List of public gateway IPs
GetVpcNatGatewayEgressPublicGateway
- Ipv4 string
- IPv4 address
- Ipv4 string
- IPv4 address
- ipv4 String
- IPv4 address
- ipv4 string
- IPv4 address
- ipv4 str
- IPv4 address
- ipv4 String
- IPv4 address
GetVpcNatGatewayVpc
- Default
Gateway bool - Indicates if this is the default VPC NAT Gateway in the VPC
- Gateway
Ip string - Gateway IP of the VPC NAT Gateway
- Vpc
Uuid string - ID of the ingress VPC
- Default
Gateway bool - Indicates if this is the default VPC NAT Gateway in the VPC
- Gateway
Ip string - Gateway IP of the VPC NAT Gateway
- Vpc
Uuid string - ID of the ingress VPC
- default
Gateway Boolean - Indicates if this is the default VPC NAT Gateway in the VPC
- gateway
Ip String - Gateway IP of the VPC NAT Gateway
- vpc
Uuid String - ID of the ingress VPC
- default
Gateway boolean - Indicates if this is the default VPC NAT Gateway in the VPC
- gateway
Ip string - Gateway IP of the VPC NAT Gateway
- vpc
Uuid string - ID of the ingress VPC
- default_
gateway bool - Indicates if this is the default VPC NAT Gateway in the VPC
- gateway_
ip str - Gateway IP of the VPC NAT Gateway
- vpc_
uuid str - ID of the ingress VPC
- default
Gateway Boolean - Indicates if this is the default VPC NAT Gateway in the VPC
- gateway
Ip String - Gateway IP of the VPC NAT Gateway
- vpc
Uuid String - ID of the ingress VPC
Package Details
- Repository
- DigitalOcean pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitaloceanTerraform Provider.
published on Wednesday, Mar 25, 2026 by Pulumi
