Oracle Cloud Infrastructure v2.33.0 published on Thursday, May 1, 2025 by Pulumi
oci.Core.getNatGateway
Explore with Pulumi AI
This data source provides details about a specific Nat Gateway resource in Oracle Cloud Infrastructure Core service.
Gets the specified NAT gateway’s information.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testNatGateway = oci.Core.getNatGateway({
    natGatewayId: testNatGatewayOciCoreNatGateway.id,
});
import pulumi
import pulumi_oci as oci
test_nat_gateway = oci.Core.get_nat_gateway(nat_gateway_id=test_nat_gateway_oci_core_nat_gateway["id"])
package main
import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/core"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := core.GetNatGateway(ctx, &core.GetNatGatewayArgs{
			NatGatewayId: testNatGatewayOciCoreNatGateway.Id,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() => 
{
    var testNatGateway = Oci.Core.GetNatGateway.Invoke(new()
    {
        NatGatewayId = testNatGatewayOciCoreNatGateway.Id,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Core.CoreFunctions;
import com.pulumi.oci.Core.inputs.GetNatGatewayArgs;
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 testNatGateway = CoreFunctions.getNatGateway(GetNatGatewayArgs.builder()
            .natGatewayId(testNatGatewayOciCoreNatGateway.id())
            .build());
    }
}
variables:
  testNatGateway:
    fn::invoke:
      function: oci:Core:getNatGateway
      arguments:
        natGatewayId: ${testNatGatewayOciCoreNatGateway.id}
Using getNatGateway
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 getNatGateway(args: GetNatGatewayArgs, opts?: InvokeOptions): Promise<GetNatGatewayResult>
function getNatGatewayOutput(args: GetNatGatewayOutputArgs, opts?: InvokeOptions): Output<GetNatGatewayResult>def get_nat_gateway(nat_gateway_id: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetNatGatewayResult
def get_nat_gateway_output(nat_gateway_id: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetNatGatewayResult]func LookupNatGateway(ctx *Context, args *LookupNatGatewayArgs, opts ...InvokeOption) (*LookupNatGatewayResult, error)
func LookupNatGatewayOutput(ctx *Context, args *LookupNatGatewayOutputArgs, opts ...InvokeOption) LookupNatGatewayResultOutput> Note: This function is named LookupNatGateway in the Go SDK.
public static class GetNatGateway 
{
    public static Task<GetNatGatewayResult> InvokeAsync(GetNatGatewayArgs args, InvokeOptions? opts = null)
    public static Output<GetNatGatewayResult> Invoke(GetNatGatewayInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetNatGatewayResult> getNatGateway(GetNatGatewayArgs args, InvokeOptions options)
public static Output<GetNatGatewayResult> getNatGateway(GetNatGatewayArgs args, InvokeOptions options)
fn::invoke:
  function: oci:Core/getNatGateway:getNatGateway
  arguments:
    # arguments dictionaryThe following arguments are supported:
- NatGateway stringId 
- The NAT gateway's OCID.
- NatGateway stringId 
- The NAT gateway's OCID.
- natGateway StringId 
- The NAT gateway's OCID.
- natGateway stringId 
- The NAT gateway's OCID.
- nat_gateway_ strid 
- The NAT gateway's OCID.
- natGateway StringId 
- The NAT gateway's OCID.
getNatGateway Result
The following output properties are available:
- BlockTraffic bool
- Whether the NAT gateway blocks traffic through it. The default is false. Example:true
- CompartmentId string
- The OCID of the compartment that contains the NAT gateway.
- Dictionary<string, string>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
- DisplayName string
- A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Dictionary<string, string>
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
- Id string
- The OCID of the NAT gateway.
- NatGateway stringId 
- NatIp string
- The IP address associated with the NAT gateway.
- PublicIp stringId 
- The OCID of the public IP address associated with the NAT gateway.
- RouteTable stringId 
- The OCID of the route table used by the NAT gateway.
- State string
- The NAT gateway's current state.
- TimeCreated string
- The date and time the NAT gateway was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- VcnId string
- The OCID of the VCN the NAT gateway belongs to.
- BlockTraffic bool
- Whether the NAT gateway blocks traffic through it. The default is false. Example:true
- CompartmentId string
- The OCID of the compartment that contains the NAT gateway.
- map[string]string
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
- DisplayName string
- A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- map[string]string
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
- Id string
- The OCID of the NAT gateway.
- NatGateway stringId 
- NatIp string
- The IP address associated with the NAT gateway.
- PublicIp stringId 
- The OCID of the public IP address associated with the NAT gateway.
- RouteTable stringId 
- The OCID of the route table used by the NAT gateway.
- State string
- The NAT gateway's current state.
- TimeCreated string
- The date and time the NAT gateway was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- VcnId string
- The OCID of the VCN the NAT gateway belongs to.
- blockTraffic Boolean
- Whether the NAT gateway blocks traffic through it. The default is false. Example:true
- compartmentId String
- The OCID of the compartment that contains the NAT gateway.
- Map<String,String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
- displayName String
- A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Map<String,String>
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
- id String
- The OCID of the NAT gateway.
- natGateway StringId 
- natIp String
- The IP address associated with the NAT gateway.
- publicIp StringId 
- The OCID of the public IP address associated with the NAT gateway.
- routeTable StringId 
- The OCID of the route table used by the NAT gateway.
- state String
- The NAT gateway's current state.
- timeCreated String
- The date and time the NAT gateway was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- vcnId String
- The OCID of the VCN the NAT gateway belongs to.
- blockTraffic boolean
- Whether the NAT gateway blocks traffic through it. The default is false. Example:true
- compartmentId string
- The OCID of the compartment that contains the NAT gateway.
- {[key: string]: string}
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
- displayName string
- A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- {[key: string]: string}
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
- id string
- The OCID of the NAT gateway.
- natGateway stringId 
- natIp string
- The IP address associated with the NAT gateway.
- publicIp stringId 
- The OCID of the public IP address associated with the NAT gateway.
- routeTable stringId 
- The OCID of the route table used by the NAT gateway.
- state string
- The NAT gateway's current state.
- timeCreated string
- The date and time the NAT gateway was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- vcnId string
- The OCID of the VCN the NAT gateway belongs to.
- block_traffic bool
- Whether the NAT gateway blocks traffic through it. The default is false. Example:true
- compartment_id str
- The OCID of the compartment that contains the NAT gateway.
- Mapping[str, str]
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
- display_name str
- A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Mapping[str, str]
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
- id str
- The OCID of the NAT gateway.
- nat_gateway_ strid 
- nat_ip str
- The IP address associated with the NAT gateway.
- public_ip_ strid 
- The OCID of the public IP address associated with the NAT gateway.
- route_table_ strid 
- The OCID of the route table used by the NAT gateway.
- state str
- The NAT gateway's current state.
- time_created str
- The date and time the NAT gateway was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- vcn_id str
- The OCID of the VCN the NAT gateway belongs to.
- blockTraffic Boolean
- Whether the NAT gateway blocks traffic through it. The default is false. Example:true
- compartmentId String
- The OCID of the compartment that contains the NAT gateway.
- Map<String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
- displayName String
- A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Map<String>
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
- id String
- The OCID of the NAT gateway.
- natGateway StringId 
- natIp String
- The IP address associated with the NAT gateway.
- publicIp StringId 
- The OCID of the public IP address associated with the NAT gateway.
- routeTable StringId 
- The OCID of the route table used by the NAT gateway.
- state String
- The NAT gateway's current state.
- timeCreated String
- The date and time the NAT gateway was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- vcnId String
- The OCID of the VCN the NAT gateway belongs to.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.