ionoscloud.getNatgatewayRule
Explore with Pulumi AI
The NAT Gateway Rule data source can be used to search for and return existing NAT Gateway Rules. 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.getNatgatewayRule({
datacenterId: "datacenter_id",
id: "natgateway_rule_id",
natgatewayId: "natgateway_id",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.get_natgateway_rule(datacenter_id="datacenter_id",
id="natgateway_rule_id",
natgateway_id="natgateway_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.LookupNatgatewayRule(ctx, &ionoscloud.LookupNatgatewayRuleArgs{
DatacenterId: "datacenter_id",
Id: pulumi.StringRef("natgateway_rule_id"),
NatgatewayId: "natgateway_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.GetNatgatewayRule.Invoke(new()
{
DatacenterId = "datacenter_id",
Id = "natgateway_rule_id",
NatgatewayId = "natgateway_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.GetNatgatewayRuleArgs;
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.getNatgatewayRule(GetNatgatewayRuleArgs.builder()
.datacenterId("datacenter_id")
.id("natgateway_rule_id")
.natgatewayId("natgateway_id")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:getNatgatewayRule
arguments:
datacenterId: datacenter_id
id: natgateway_rule_id
natgatewayId: natgateway_id
By Name
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.getNatgatewayRule({
datacenterId: "datacenter_id",
name: "NAT Gateway Rule Example",
natgatewayId: "natgateway_id",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.get_natgateway_rule(datacenter_id="datacenter_id",
name="NAT Gateway Rule Example",
natgateway_id="natgateway_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.LookupNatgatewayRule(ctx, &ionoscloud.LookupNatgatewayRuleArgs{
DatacenterId: "datacenter_id",
Name: pulumi.StringRef("NAT Gateway Rule Example"),
NatgatewayId: "natgateway_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.GetNatgatewayRule.Invoke(new()
{
DatacenterId = "datacenter_id",
Name = "NAT Gateway Rule Example",
NatgatewayId = "natgateway_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.GetNatgatewayRuleArgs;
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.getNatgatewayRule(GetNatgatewayRuleArgs.builder()
.datacenterId("datacenter_id")
.name("NAT Gateway Rule Example")
.natgatewayId("natgateway_id")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:getNatgatewayRule
arguments:
datacenterId: datacenter_id
name: NAT Gateway Rule Example
natgatewayId: natgateway_id
Using getNatgatewayRule
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 getNatgatewayRule(args: GetNatgatewayRuleArgs, opts?: InvokeOptions): Promise<GetNatgatewayRuleResult>
function getNatgatewayRuleOutput(args: GetNatgatewayRuleOutputArgs, opts?: InvokeOptions): Output<GetNatgatewayRuleResult>
def get_natgateway_rule(datacenter_id: Optional[str] = None,
id: Optional[str] = None,
name: Optional[str] = None,
natgateway_id: Optional[str] = None,
timeouts: Optional[GetNatgatewayRuleTimeouts] = None,
opts: Optional[InvokeOptions] = None) -> GetNatgatewayRuleResult
def get_natgateway_rule_output(datacenter_id: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
natgateway_id: Optional[pulumi.Input[str]] = None,
timeouts: Optional[pulumi.Input[GetNatgatewayRuleTimeoutsArgs]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetNatgatewayRuleResult]
func LookupNatgatewayRule(ctx *Context, args *LookupNatgatewayRuleArgs, opts ...InvokeOption) (*LookupNatgatewayRuleResult, error)
func LookupNatgatewayRuleOutput(ctx *Context, args *LookupNatgatewayRuleOutputArgs, opts ...InvokeOption) LookupNatgatewayRuleResultOutput
> Note: This function is named LookupNatgatewayRule
in the Go SDK.
public static class GetNatgatewayRule
{
public static Task<GetNatgatewayRuleResult> InvokeAsync(GetNatgatewayRuleArgs args, InvokeOptions? opts = null)
public static Output<GetNatgatewayRuleResult> Invoke(GetNatgatewayRuleInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetNatgatewayRuleResult> getNatgatewayRule(GetNatgatewayRuleArgs args, InvokeOptions options)
public static Output<GetNatgatewayRuleResult> getNatgatewayRule(GetNatgatewayRuleArgs args, InvokeOptions options)
fn::invoke:
function: ionoscloud:index/getNatgatewayRule:getNatgatewayRule
arguments:
# arguments dictionary
The following arguments are supported:
- Datacenter
Id string - Datacenter's UUID.
- Natgateway
Id string - Nat Gateway's UUID.
- Id string
ID of the NAT gateway rule you want to search for.
Both
datacenter_id
andnatgateway_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 NAT gateway rule that you want to search for.
- Timeouts
Get
Natgateway Rule Timeouts
- Datacenter
Id string - Datacenter's UUID.
- Natgateway
Id string - Nat Gateway's UUID.
- Id string
ID of the NAT gateway rule you want to search for.
Both
datacenter_id
andnatgateway_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 NAT gateway rule that you want to search for.
- Timeouts
Get
Natgateway Rule Timeouts
- datacenter
Id String - Datacenter's UUID.
- natgateway
Id String - Nat Gateway's UUID.
- id String
ID of the NAT gateway rule you want to search for.
Both
datacenter_id
andnatgateway_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 NAT gateway rule that you want to search for.
- timeouts
Get
Natgateway Rule Timeouts
- datacenter
Id string - Datacenter's UUID.
- natgateway
Id string - Nat Gateway's UUID.
- id string
ID of the NAT gateway rule you want to search for.
Both
datacenter_id
andnatgateway_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 NAT gateway rule that you want to search for.
- timeouts
Get
Natgateway Rule Timeouts
- datacenter_
id str - Datacenter's UUID.
- natgateway_
id str - Nat Gateway's UUID.
- id str
ID of the NAT gateway rule you want to search for.
Both
datacenter_id
andnatgateway_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 NAT gateway rule that you want to search for.
- timeouts
Get
Natgateway Rule Timeouts
- datacenter
Id String - Datacenter's UUID.
- natgateway
Id String - Nat Gateway's UUID.
- id String
ID of the NAT gateway rule you want to search for.
Both
datacenter_id
andnatgateway_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 NAT gateway rule that you want to search for.
- timeouts Property Map
getNatgatewayRule Result
The following output properties are available:
- Datacenter
Id string - Id string
- Id of the NAT gateway rule
- Name string
- Name of the NAT gateway rule
- Natgateway
Id string - Protocol string
- Protocol of the NAT gateway rule. Defaults to ALL. If protocol is 'ICMP' then targetPortRange start and end cannot be set.
- Public
Ip string - Public IP address of the NAT gateway rule. Specifies the address used for masking outgoing packets source address field. Should be one of the customer reserved IP address already configured on the NAT gateway resource
- Source
Subnet string - Source subnet of the NAT gateway rule. For SNAT rules it specifies which packets this translation rule applies to based on the packets source IP address.
- Target
Port List<GetRanges Natgateway Rule Target Port Range> - Target port range of the NAT gateway rule. For SNAT rules it specifies which packets this translation rule applies to based on destination port. If none is provided, rule will match any port
- Target
Subnet string - Target or destination subnet of the NAT gateway rule. For SNAT rules it specifies which packets this translation rule applies to based on the packets destination IP address. If none is provided, rule will match any address.
- Type string
- ype of the NAT gateway rule.
- Timeouts
Get
Natgateway Rule Timeouts
- Datacenter
Id string - Id string
- Id of the NAT gateway rule
- Name string
- Name of the NAT gateway rule
- Natgateway
Id string - Protocol string
- Protocol of the NAT gateway rule. Defaults to ALL. If protocol is 'ICMP' then targetPortRange start and end cannot be set.
- Public
Ip string - Public IP address of the NAT gateway rule. Specifies the address used for masking outgoing packets source address field. Should be one of the customer reserved IP address already configured on the NAT gateway resource
- Source
Subnet string - Source subnet of the NAT gateway rule. For SNAT rules it specifies which packets this translation rule applies to based on the packets source IP address.
- Target
Port []GetRanges Natgateway Rule Target Port Range - Target port range of the NAT gateway rule. For SNAT rules it specifies which packets this translation rule applies to based on destination port. If none is provided, rule will match any port
- Target
Subnet string - Target or destination subnet of the NAT gateway rule. For SNAT rules it specifies which packets this translation rule applies to based on the packets destination IP address. If none is provided, rule will match any address.
- Type string
- ype of the NAT gateway rule.
- Timeouts
Get
Natgateway Rule Timeouts
- datacenter
Id String - id String
- Id of the NAT gateway rule
- name String
- Name of the NAT gateway rule
- natgateway
Id String - protocol String
- Protocol of the NAT gateway rule. Defaults to ALL. If protocol is 'ICMP' then targetPortRange start and end cannot be set.
- public
Ip String - Public IP address of the NAT gateway rule. Specifies the address used for masking outgoing packets source address field. Should be one of the customer reserved IP address already configured on the NAT gateway resource
- source
Subnet String - Source subnet of the NAT gateway rule. For SNAT rules it specifies which packets this translation rule applies to based on the packets source IP address.
- target
Port List<GetRanges Natgateway Rule Target Port Range> - Target port range of the NAT gateway rule. For SNAT rules it specifies which packets this translation rule applies to based on destination port. If none is provided, rule will match any port
- target
Subnet String - Target or destination subnet of the NAT gateway rule. For SNAT rules it specifies which packets this translation rule applies to based on the packets destination IP address. If none is provided, rule will match any address.
- type String
- ype of the NAT gateway rule.
- timeouts
Get
Natgateway Rule Timeouts
- datacenter
Id string - id string
- Id of the NAT gateway rule
- name string
- Name of the NAT gateway rule
- natgateway
Id string - protocol string
- Protocol of the NAT gateway rule. Defaults to ALL. If protocol is 'ICMP' then targetPortRange start and end cannot be set.
- public
Ip string - Public IP address of the NAT gateway rule. Specifies the address used for masking outgoing packets source address field. Should be one of the customer reserved IP address already configured on the NAT gateway resource
- source
Subnet string - Source subnet of the NAT gateway rule. For SNAT rules it specifies which packets this translation rule applies to based on the packets source IP address.
- target
Port GetRanges Natgateway Rule Target Port Range[] - Target port range of the NAT gateway rule. For SNAT rules it specifies which packets this translation rule applies to based on destination port. If none is provided, rule will match any port
- target
Subnet string - Target or destination subnet of the NAT gateway rule. For SNAT rules it specifies which packets this translation rule applies to based on the packets destination IP address. If none is provided, rule will match any address.
- type string
- ype of the NAT gateway rule.
- timeouts
Get
Natgateway Rule Timeouts
- datacenter_
id str - id str
- Id of the NAT gateway rule
- name str
- Name of the NAT gateway rule
- natgateway_
id str - protocol str
- Protocol of the NAT gateway rule. Defaults to ALL. If protocol is 'ICMP' then targetPortRange start and end cannot be set.
- public_
ip str - Public IP address of the NAT gateway rule. Specifies the address used for masking outgoing packets source address field. Should be one of the customer reserved IP address already configured on the NAT gateway resource
- source_
subnet str - Source subnet of the NAT gateway rule. For SNAT rules it specifies which packets this translation rule applies to based on the packets source IP address.
- target_
port_ Sequence[Getranges Natgateway Rule Target Port Range] - Target port range of the NAT gateway rule. For SNAT rules it specifies which packets this translation rule applies to based on destination port. If none is provided, rule will match any port
- target_
subnet str - Target or destination subnet of the NAT gateway rule. For SNAT rules it specifies which packets this translation rule applies to based on the packets destination IP address. If none is provided, rule will match any address.
- type str
- ype of the NAT gateway rule.
- timeouts
Get
Natgateway Rule Timeouts
- datacenter
Id String - id String
- Id of the NAT gateway rule
- name String
- Name of the NAT gateway rule
- natgateway
Id String - protocol String
- Protocol of the NAT gateway rule. Defaults to ALL. If protocol is 'ICMP' then targetPortRange start and end cannot be set.
- public
Ip String - Public IP address of the NAT gateway rule. Specifies the address used for masking outgoing packets source address field. Should be one of the customer reserved IP address already configured on the NAT gateway resource
- source
Subnet String - Source subnet of the NAT gateway rule. For SNAT rules it specifies which packets this translation rule applies to based on the packets source IP address.
- target
Port List<Property Map>Ranges - Target port range of the NAT gateway rule. For SNAT rules it specifies which packets this translation rule applies to based on destination port. If none is provided, rule will match any port
- target
Subnet String - Target or destination subnet of the NAT gateway rule. For SNAT rules it specifies which packets this translation rule applies to based on the packets destination IP address. If none is provided, rule will match any address.
- type String
- ype of the NAT gateway rule.
- timeouts Property Map
Supporting Types
GetNatgatewayRuleTargetPortRange
GetNatgatewayRuleTimeouts
Package Details
- Repository
- ionoscloud ionos-cloud/terraform-provider-ionoscloud
- License
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.