Oracle Cloud Infrastructure
getNatGateways
This data source provides the list of Nat Gateways in Oracle Cloud Infrastructure Core service.
Lists the NAT gateways in the specified compartment. You may optionally specify a VCN OCID to filter the results by VCN.
Example Usage
using Pulumi;
using Oci = Pulumi.Oci;
class MyStack : Stack
{
public MyStack()
{
var testNatGateways = Output.Create(Oci.Core.GetNatGateways.InvokeAsync(new Oci.Core.GetNatGatewaysArgs
{
CompartmentId = @var.Compartment_id,
DisplayName = @var.Nat_gateway_display_name,
State = @var.Nat_gateway_state,
VcnId = oci_core_vcn.Test_vcn.Id,
}));
}
}
package main
import (
"github.com/pulumi/pulumi-oci/sdk/go/oci/Core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := Core.GetNatGateways(ctx, &core.GetNatGatewaysArgs{
CompartmentId: _var.Compartment_id,
DisplayName: pulumi.StringRef(_var.Nat_gateway_display_name),
State: pulumi.StringRef(_var.Nat_gateway_state),
VcnId: pulumi.StringRef(oci_core_vcn.Test_vcn.Id),
}, nil)
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_oci as oci
test_nat_gateways = oci.Core.get_nat_gateways(compartment_id=var["compartment_id"],
display_name=var["nat_gateway_display_name"],
state=var["nat_gateway_state"],
vcn_id=oci_core_vcn["test_vcn"]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testNatGateways = oci.Core.getNatGateways({
compartmentId: _var.compartment_id,
displayName: _var.nat_gateway_display_name,
state: _var.nat_gateway_state,
vcnId: oci_core_vcn.test_vcn.id,
});
Coming soon!
Using getNatGateways
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 getNatGateways(args: GetNatGatewaysArgs, opts?: InvokeOptions): Promise<GetNatGatewaysResult>
function getNatGatewaysOutput(args: GetNatGatewaysOutputArgs, opts?: InvokeOptions): Output<GetNatGatewaysResult>
def get_nat_gateways(compartment_id: Optional[str] = None,
display_name: Optional[str] = None,
filters: Optional[Sequence[_core.GetNatGatewaysFilter]] = None,
state: Optional[str] = None,
vcn_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetNatGatewaysResult
def get_nat_gateways_output(compartment_id: Optional[pulumi.Input[str]] = None,
display_name: Optional[pulumi.Input[str]] = None,
filters: Optional[pulumi.Input[Sequence[pulumi.Input[_core.GetNatGatewaysFilterArgs]]]] = None,
state: Optional[pulumi.Input[str]] = None,
vcn_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetNatGatewaysResult]
func GetNatGateways(ctx *Context, args *GetNatGatewaysArgs, opts ...InvokeOption) (*GetNatGatewaysResult, error)
func GetNatGatewaysOutput(ctx *Context, args *GetNatGatewaysOutputArgs, opts ...InvokeOption) GetNatGatewaysResultOutput
> Note: This function is named GetNatGateways
in the Go SDK.
public static class GetNatGateways
{
public static Task<GetNatGatewaysResult> InvokeAsync(GetNatGatewaysArgs args, InvokeOptions? opts = null)
public static Output<GetNatGatewaysResult> Invoke(GetNatGatewaysInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetNatGatewaysResult> getNatGateways(GetNatGatewaysArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: oci:Core/getNatGateways:getNatGateways
Arguments:
# Arguments dictionary
The following arguments are supported:
- Compartment
Id string The OCID of the compartment.
- Display
Name string A filter to return only resources that match the given display name exactly.
- Filters
List<Get
Nat Gateways Filter> - State string
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- Vcn
Id string The OCID of the VCN.
- Compartment
Id string The OCID of the compartment.
- Display
Name string A filter to return only resources that match the given display name exactly.
- Filters
[]Get
Nat Gateways Filter - State string
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- Vcn
Id string The OCID of the VCN.
- compartment
Id String The OCID of the compartment.
- display
Name String A filter to return only resources that match the given display name exactly.
- filters
List<Get
Nat Gateways Filter> - state String
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- vcn
Id String The OCID of the VCN.
- compartment
Id string The OCID of the compartment.
- display
Name string A filter to return only resources that match the given display name exactly.
- filters
Get
Nat Gateways Filter[] - state string
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- vcn
Id string The OCID of the VCN.
- compartment_
id str The OCID of the compartment.
- display_
name str A filter to return only resources that match the given display name exactly.
- filters
Get
Nat Gateways Filter] - state str
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- vcn_
id str The OCID of the VCN.
- compartment
Id String The OCID of the compartment.
- display
Name String A filter to return only resources that match the given display name exactly.
- filters List<Property Map>
- state String
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- vcn
Id String The OCID of the VCN.
getNatGateways Result
The following output properties are available:
- Compartment
Id string The OCID of the compartment that contains the NAT gateway.
- Id string
The provider-assigned unique ID for this managed resource.
- Nat
Gateways List<GetNat Gateways Nat Gateway> The list of nat_gateways.
- Display
Name string A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Filters
List<Get
Nat Gateways Filter> - State string
The NAT gateway's current state.
- Vcn
Id string The OCID of the VCN the NAT gateway belongs to.
- Compartment
Id string The OCID of the compartment that contains the NAT gateway.
- Id string
The provider-assigned unique ID for this managed resource.
- Nat
Gateways []GetNat Gateways Nat Gateway The list of nat_gateways.
- Display
Name string A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Filters
[]Get
Nat Gateways Filter - State string
The NAT gateway's current state.
- Vcn
Id string The OCID of the VCN the NAT gateway belongs to.
- compartment
Id String The OCID of the compartment that contains the NAT gateway.
- id String
The provider-assigned unique ID for this managed resource.
- nat
Gateways List<GetNat Gateways Nat Gateway> The list of nat_gateways.
- display
Name String A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- filters
List<Get
Nat Gateways Filter> - state String
The NAT gateway's current state.
- vcn
Id String The OCID of the VCN the NAT gateway belongs to.
- compartment
Id string The OCID of the compartment that contains the NAT gateway.
- id string
The provider-assigned unique ID for this managed resource.
- nat
Gateways GetNat Gateways Nat Gateway[] The list of nat_gateways.
- display
Name string A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- filters
Get
Nat Gateways Filter[] - state string
The NAT gateway's current state.
- vcn
Id string The OCID of the VCN the NAT gateway belongs to.
- compartment_
id str The OCID of the compartment that contains the NAT gateway.
- id str
The provider-assigned unique ID for this managed resource.
- nat_
gateways GetNat Gateways Nat Gateway] The list of nat_gateways.
- display_
name str A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- filters
Get
Nat Gateways Filter] - state str
The NAT gateway's current state.
- vcn_
id str The OCID of the VCN the NAT gateway belongs to.
- compartment
Id String The OCID of the compartment that contains the NAT gateway.
- id String
The provider-assigned unique ID for this managed resource.
- nat
Gateways List<Property Map> The list of nat_gateways.
- display
Name String A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- filters List<Property Map>
- state String
The NAT gateway's current state.
- vcn
Id String The OCID of the VCN the NAT gateway belongs to.
Supporting Types
GetNatGatewaysFilter
GetNatGatewaysNatGateway
- Block
Traffic bool Whether the NAT gateway blocks traffic through it. The default is
false
. Example:true
- Compartment
Id string The OCID of the compartment.
- Dictionary<string, object>
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 string A filter to return only resources that match the given display name exactly.
- Dictionary<string, object>
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.
- Nat
Ip string The IP address associated with the NAT gateway.
- Public
Ip stringId The OCID of the public IP address associated with the NAT gateway.
- State string
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- Time
Created string The date and time the NAT gateway was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- Vcn
Id string The OCID of the VCN.
- Block
Traffic bool Whether the NAT gateway blocks traffic through it. The default is
false
. Example:true
- Compartment
Id string The OCID of the compartment.
- map[string]interface{}
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 string A filter to return only resources that match the given display name exactly.
- map[string]interface{}
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.
- Nat
Ip string The IP address associated with the NAT gateway.
- Public
Ip stringId The OCID of the public IP address associated with the NAT gateway.
- State string
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- Time
Created string The date and time the NAT gateway was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- Vcn
Id string The OCID of the VCN.
- block
Traffic Boolean Whether the NAT gateway blocks traffic through it. The default is
false
. Example:true
- compartment
Id String The OCID of the compartment.
- Map<String,Object>
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 String A filter to return only resources that match the given display name exactly.
- Map<String,Object>
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.
- nat
Ip String The IP address associated with the NAT gateway.
- public
Ip StringId The OCID of the public IP address associated with the NAT gateway.
- state String
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- time
Created String The date and time the NAT gateway was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- vcn
Id String The OCID of the VCN.
- block
Traffic boolean Whether the NAT gateway blocks traffic through it. The default is
false
. Example:true
- compartment
Id string The OCID of the compartment.
- {[key: string]: any}
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 string A filter to return only resources that match the given display name exactly.
- {[key: string]: any}
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.
- nat
Ip string The IP address associated with the NAT gateway.
- public
Ip stringId The OCID of the public IP address associated with the NAT gateway.
- state string
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- time
Created string The date and time the NAT gateway was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- vcn
Id string The OCID of the VCN.
- 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.
- Mapping[str, Any]
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 filter to return only resources that match the given display name exactly.
- Mapping[str, Any]
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_
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.
- state str
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- 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.
- block
Traffic Boolean Whether the NAT gateway blocks traffic through it. The default is
false
. Example:true
- compartment
Id String The OCID of the compartment.
- Map<Any>
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 String A filter to return only resources that match the given display name exactly.
- Map<Any>
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.
- nat
Ip String The IP address associated with the NAT gateway.
- public
Ip StringId The OCID of the public IP address associated with the NAT gateway.
- state String
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- time
Created String The date and time the NAT gateway was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- vcn
Id String The OCID of the VCN.
Package Details
- Repository
- https://github.com/pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
oci
Terraform Provider.