ionoscloud.getNatgateway
Explore with Pulumi AI
The NAT gateway data source can be used to search for and return existing NAT Gateways. If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned. When this happens, please refine your search string so that it is specific enough to return only one result.
Example Usage
By ID
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.getNatgateway({
datacenterId: "datacenter_id",
id: "nat_gateway_id",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.get_natgateway(datacenter_id="datacenter_id",
id="nat_gateway_id")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ionoscloud.LookupNatgateway(ctx, &ionoscloud.LookupNatgatewayArgs{
DatacenterId: "datacenter_id",
Id: pulumi.StringRef("nat_gateway_id"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.GetNatgateway.Invoke(new()
{
DatacenterId = "datacenter_id",
Id = "nat_gateway_id",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.IonoscloudFunctions;
import com.pulumi.ionoscloud.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 example = IonoscloudFunctions.getNatgateway(GetNatgatewayArgs.builder()
.datacenterId("datacenter_id")
.id("nat_gateway_id")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:getNatgateway
arguments:
datacenterId: datacenter_id
id: nat_gateway_id
By Name
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.getNatgateway({
datacenterId: "datacenter_id",
name: "NAT Gateway Example",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.get_natgateway(datacenter_id="datacenter_id",
name="NAT Gateway Example")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ionoscloud.LookupNatgateway(ctx, &ionoscloud.LookupNatgatewayArgs{
DatacenterId: "datacenter_id",
Name: pulumi.StringRef("NAT Gateway Example"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.GetNatgateway.Invoke(new()
{
DatacenterId = "datacenter_id",
Name = "NAT Gateway Example",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.IonoscloudFunctions;
import com.pulumi.ionoscloud.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 example = IonoscloudFunctions.getNatgateway(GetNatgatewayArgs.builder()
.datacenterId("datacenter_id")
.name("NAT Gateway Example")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:getNatgateway
arguments:
datacenterId: datacenter_id
name: NAT Gateway Example
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_natgateway(datacenter_id: Optional[str] = None,
id: Optional[str] = None,
name: Optional[str] = None,
timeouts: Optional[GetNatgatewayTimeouts] = None,
opts: Optional[InvokeOptions] = None) -> GetNatgatewayResult
def get_natgateway_output(datacenter_id: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
timeouts: Optional[pulumi.Input[GetNatgatewayTimeoutsArgs]] = 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: ionoscloud:index/getNatgateway:getNatgateway
arguments:
# arguments dictionary
The following arguments are supported:
- Datacenter
Id string - Datacenter's UUID.
- Id string
ID of the network load balancer forwarding rule you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- Name string
- Name of an existing network load balancer forwarding rule that you want to search for.
- Timeouts
Get
Natgateway Timeouts
- Datacenter
Id string - Datacenter's UUID.
- Id string
ID of the network load balancer forwarding rule you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- Name string
- Name of an existing network load balancer forwarding rule that you want to search for.
- Timeouts
Get
Natgateway Timeouts
- datacenter
Id String - Datacenter's UUID.
- id String
ID of the network load balancer forwarding rule you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- name String
- Name of an existing network load balancer forwarding rule that you want to search for.
- timeouts
Get
Natgateway Timeouts
- datacenter
Id string - Datacenter's UUID.
- id string
ID of the network load balancer forwarding rule you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- name string
- Name of an existing network load balancer forwarding rule that you want to search for.
- timeouts
Get
Natgateway Timeouts
- datacenter_
id str - Datacenter's UUID.
- id str
ID of the network load balancer forwarding rule you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- name str
- Name of an existing network load balancer forwarding rule that you want to search for.
- timeouts
Get
Natgateway Timeouts
- datacenter
Id String - Datacenter's UUID.
- id String
ID of the network load balancer forwarding rule you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- name String
- Name of an existing network load balancer forwarding rule that you want to search for.
- timeouts Property Map
getNatgateway Result
The following output properties are available:
- Datacenter
Id string - Id string
- Id for the LAN connected to the NAT gateway
- Lans
List<Get
Natgateway Lan> - Collection of LANs connected to the NAT gateway. IPs must contain valid subnet mask. If user will not provide any IP then system will generate an IP with /24 subnet.
- Name string
- Name of that natgateway
- Public
Ips List<string> - Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location
- Timeouts
Get
Natgateway Timeouts
- Datacenter
Id string - Id string
- Id for the LAN connected to the NAT gateway
- Lans
[]Get
Natgateway Lan - Collection of LANs connected to the NAT gateway. IPs must contain valid subnet mask. If user will not provide any IP then system will generate an IP with /24 subnet.
- Name string
- Name of that natgateway
- Public
Ips []string - Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location
- Timeouts
Get
Natgateway Timeouts
- datacenter
Id String - id String
- Id for the LAN connected to the NAT gateway
- lans
List<Get
Natgateway Lan> - Collection of LANs connected to the NAT gateway. IPs must contain valid subnet mask. If user will not provide any IP then system will generate an IP with /24 subnet.
- name String
- Name of that natgateway
- public
Ips List<String> - Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location
- timeouts
Get
Natgateway Timeouts
- datacenter
Id string - id string
- Id for the LAN connected to the NAT gateway
- lans
Get
Natgateway Lan[] - Collection of LANs connected to the NAT gateway. IPs must contain valid subnet mask. If user will not provide any IP then system will generate an IP with /24 subnet.
- name string
- Name of that natgateway
- public
Ips string[] - Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location
- timeouts
Get
Natgateway Timeouts
- datacenter_
id str - id str
- Id for the LAN connected to the NAT gateway
- lans
Sequence[Get
Natgateway Lan] - Collection of LANs connected to the NAT gateway. IPs must contain valid subnet mask. If user will not provide any IP then system will generate an IP with /24 subnet.
- name str
- Name of that natgateway
- public_
ips Sequence[str] - Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location
- timeouts
Get
Natgateway Timeouts
- datacenter
Id String - id String
- Id for the LAN connected to the NAT gateway
- lans List<Property Map>
- Collection of LANs connected to the NAT gateway. IPs must contain valid subnet mask. If user will not provide any IP then system will generate an IP with /24 subnet.
- name String
- Name of that natgateway
- public
Ips List<String> - Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location
- timeouts Property Map
Supporting Types
GetNatgatewayLan
- Gateway
Ips List<string> - Collection of gateway IP addresses of the NAT gateway. Will be auto-generated if not provided. Should ideally be an IP belonging to the same subnet as the LAN
- Id double
ID of the network load balancer forwarding rule you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.
- Gateway
Ips []string - Collection of gateway IP addresses of the NAT gateway. Will be auto-generated if not provided. Should ideally be an IP belonging to the same subnet as the LAN
- Id float64
ID of the network load balancer forwarding rule you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.
- gateway
Ips List<String> - Collection of gateway IP addresses of the NAT gateway. Will be auto-generated if not provided. Should ideally be an IP belonging to the same subnet as the LAN
- id Double
ID of the network load balancer forwarding rule you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.
- gateway
Ips string[] - Collection of gateway IP addresses of the NAT gateway. Will be auto-generated if not provided. Should ideally be an IP belonging to the same subnet as the LAN
- id number
ID of the network load balancer forwarding rule you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.
- gateway_
ips Sequence[str] - Collection of gateway IP addresses of the NAT gateway. Will be auto-generated if not provided. Should ideally be an IP belonging to the same subnet as the LAN
- id float
ID of the network load balancer forwarding rule you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.
- gateway
Ips List<String> - Collection of gateway IP addresses of the NAT gateway. Will be auto-generated if not provided. Should ideally be an IP belonging to the same subnet as the LAN
- id Number
ID of the network load balancer forwarding rule you want to search for.
datacenter_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.
GetNatgatewayTimeouts
Package Details
- Repository
- ionoscloud ionos-cloud/terraform-provider-ionoscloud
- License
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.