hpegl.VmaasRouterNatRule
Explore with Pulumi AI
Compatible version >= 5.2.10
Router NAT rule resource facilitates creating,
updating and deleting NSX-T Network Router NAT rules.
hpegl.VmaasRouterNatRule
resource supports NSX-T network router NAT rule creation.
For creating an NSX-T network router NAT rule, please refer following examples.
Example Usage
Creating NSX-T Network Router NAT Rule With All Possible Attributes
import * as pulumi from "@pulumi/pulumi";
import * as hpegl from "@pulumi/hpegl";
// (C) Copyright 2021 Hewlett Packard Enterprise Development LP
const tfNat = new hpegl.VmaasRouterNatRule("tfNat", {
routerId: data.hpegl_vmaas_router.tf_router.id,
enabled: true,
description: "NAT rule created via terraform",
config: {
action: "DNAT",
logging: true,
firewall: "MATCH_EXTERNAL_ADDRESS",
},
sourceNetwork: "1.1.3.0/24",
translatedNetwork: "1.1.1.0/24",
destinationNetwork: "1.1.2.0/24",
translatedPorts: 22,
priority: 120,
});
import pulumi
import pulumi_hpegl as hpegl
# (C) Copyright 2021 Hewlett Packard Enterprise Development LP
tf_nat = hpegl.VmaasRouterNatRule("tfNat",
router_id=data["hpegl_vmaas_router"]["tf_router"]["id"],
enabled=True,
description="NAT rule created via terraform",
config={
"action": "DNAT",
"logging": True,
"firewall": "MATCH_EXTERNAL_ADDRESS",
},
source_network="1.1.3.0/24",
translated_network="1.1.1.0/24",
destination_network="1.1.2.0/24",
translated_ports=22,
priority=120)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/hpegl/hpegl"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// (C) Copyright 2021 Hewlett Packard Enterprise Development LP
_, err := hpegl.NewVmaasRouterNatRule(ctx, "tfNat", &hpegl.VmaasRouterNatRuleArgs{
RouterId: pulumi.Any(data.Hpegl_vmaas_router.Tf_router.Id),
Enabled: pulumi.Bool(true),
Description: pulumi.String("NAT rule created via terraform"),
Config: &hpegl.VmaasRouterNatRuleConfigArgs{
Action: pulumi.String("DNAT"),
Logging: pulumi.Bool(true),
Firewall: pulumi.String("MATCH_EXTERNAL_ADDRESS"),
},
SourceNetwork: pulumi.String("1.1.3.0/24"),
TranslatedNetwork: pulumi.String("1.1.1.0/24"),
DestinationNetwork: pulumi.String("1.1.2.0/24"),
TranslatedPorts: pulumi.Float64(22),
Priority: pulumi.Float64(120),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Hpegl = Pulumi.Hpegl;
return await Deployment.RunAsync(() =>
{
// (C) Copyright 2021 Hewlett Packard Enterprise Development LP
var tfNat = new Hpegl.VmaasRouterNatRule("tfNat", new()
{
RouterId = data.Hpegl_vmaas_router.Tf_router.Id,
Enabled = true,
Description = "NAT rule created via terraform",
Config = new Hpegl.Inputs.VmaasRouterNatRuleConfigArgs
{
Action = "DNAT",
Logging = true,
Firewall = "MATCH_EXTERNAL_ADDRESS",
},
SourceNetwork = "1.1.3.0/24",
TranslatedNetwork = "1.1.1.0/24",
DestinationNetwork = "1.1.2.0/24",
TranslatedPorts = 22,
Priority = 120,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.hpegl.VmaasRouterNatRule;
import com.pulumi.hpegl.VmaasRouterNatRuleArgs;
import com.pulumi.hpegl.inputs.VmaasRouterNatRuleConfigArgs;
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) {
// (C) Copyright 2021 Hewlett Packard Enterprise Development LP
var tfNat = new VmaasRouterNatRule("tfNat", VmaasRouterNatRuleArgs.builder()
.routerId(data.hpegl_vmaas_router().tf_router().id())
.enabled(true)
.description("NAT rule created via terraform")
.config(VmaasRouterNatRuleConfigArgs.builder()
.action("DNAT")
.logging(true)
.firewall("MATCH_EXTERNAL_ADDRESS")
.build())
.sourceNetwork("1.1.3.0/24")
.translatedNetwork("1.1.1.0/24")
.destinationNetwork("1.1.2.0/24")
.translatedPorts(22)
.priority(120)
.build());
}
}
resources:
# (C) Copyright 2021 Hewlett Packard Enterprise Development LP
tfNat:
type: hpegl:VmaasRouterNatRule
properties:
routerId: ${data.hpegl_vmaas_router.tf_router.id}
enabled: true
description: NAT rule created via terraform
config:
action: DNAT
logging: true
firewall: MATCH_EXTERNAL_ADDRESS
sourceNetwork: 1.1.3.0/24
translatedNetwork: 1.1.1.0/24
destinationNetwork: 1.1.2.0/24
translatedPorts: 22
priority: 120
destination_network
should be set whenaction
is set toDNAT
. Similarlysource_network
should be set whenaction
is set toSNAT
.
Create VmaasRouterNatRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VmaasRouterNatRule(name: string, args: VmaasRouterNatRuleArgs, opts?: CustomResourceOptions);
@overload
def VmaasRouterNatRule(resource_name: str,
args: VmaasRouterNatRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def VmaasRouterNatRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
config: Optional[VmaasRouterNatRuleConfigArgs] = None,
router_id: Optional[float] = None,
translated_network: Optional[str] = None,
description: Optional[str] = None,
destination_network: Optional[str] = None,
enabled: Optional[bool] = None,
name: Optional[str] = None,
priority: Optional[float] = None,
source_network: Optional[str] = None,
translated_ports: Optional[float] = None,
vmaas_router_nat_rule_id: Optional[str] = None)
func NewVmaasRouterNatRule(ctx *Context, name string, args VmaasRouterNatRuleArgs, opts ...ResourceOption) (*VmaasRouterNatRule, error)
public VmaasRouterNatRule(string name, VmaasRouterNatRuleArgs args, CustomResourceOptions? opts = null)
public VmaasRouterNatRule(String name, VmaasRouterNatRuleArgs args)
public VmaasRouterNatRule(String name, VmaasRouterNatRuleArgs args, CustomResourceOptions options)
type: hpegl:VmaasRouterNatRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args VmaasRouterNatRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args VmaasRouterNatRuleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args VmaasRouterNatRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VmaasRouterNatRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VmaasRouterNatRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var vmaasRouterNatRuleResource = new Hpegl.VmaasRouterNatRule("vmaasRouterNatRuleResource", new()
{
Config = new Hpegl.Inputs.VmaasRouterNatRuleConfigArgs
{
Action = "string",
Firewall = "string",
Logging = false,
Service = "string",
},
RouterId = 0,
TranslatedNetwork = "string",
Description = "string",
DestinationNetwork = "string",
Enabled = false,
Name = "string",
Priority = 0,
SourceNetwork = "string",
TranslatedPorts = 0,
VmaasRouterNatRuleId = "string",
});
example, err := hpegl.NewVmaasRouterNatRule(ctx, "vmaasRouterNatRuleResource", &hpegl.VmaasRouterNatRuleArgs{
Config: &hpegl.VmaasRouterNatRuleConfigArgs{
Action: pulumi.String("string"),
Firewall: pulumi.String("string"),
Logging: pulumi.Bool(false),
Service: pulumi.String("string"),
},
RouterId: pulumi.Float64(0),
TranslatedNetwork: pulumi.String("string"),
Description: pulumi.String("string"),
DestinationNetwork: pulumi.String("string"),
Enabled: pulumi.Bool(false),
Name: pulumi.String("string"),
Priority: pulumi.Float64(0),
SourceNetwork: pulumi.String("string"),
TranslatedPorts: pulumi.Float64(0),
VmaasRouterNatRuleId: pulumi.String("string"),
})
var vmaasRouterNatRuleResource = new VmaasRouterNatRule("vmaasRouterNatRuleResource", VmaasRouterNatRuleArgs.builder()
.config(VmaasRouterNatRuleConfigArgs.builder()
.action("string")
.firewall("string")
.logging(false)
.service("string")
.build())
.routerId(0)
.translatedNetwork("string")
.description("string")
.destinationNetwork("string")
.enabled(false)
.name("string")
.priority(0)
.sourceNetwork("string")
.translatedPorts(0)
.vmaasRouterNatRuleId("string")
.build());
vmaas_router_nat_rule_resource = hpegl.VmaasRouterNatRule("vmaasRouterNatRuleResource",
config={
"action": "string",
"firewall": "string",
"logging": False,
"service": "string",
},
router_id=0,
translated_network="string",
description="string",
destination_network="string",
enabled=False,
name="string",
priority=0,
source_network="string",
translated_ports=0,
vmaas_router_nat_rule_id="string")
const vmaasRouterNatRuleResource = new hpegl.VmaasRouterNatRule("vmaasRouterNatRuleResource", {
config: {
action: "string",
firewall: "string",
logging: false,
service: "string",
},
routerId: 0,
translatedNetwork: "string",
description: "string",
destinationNetwork: "string",
enabled: false,
name: "string",
priority: 0,
sourceNetwork: "string",
translatedPorts: 0,
vmaasRouterNatRuleId: "string",
});
type: hpegl:VmaasRouterNatRule
properties:
config:
action: string
firewall: string
logging: false
service: string
description: string
destinationNetwork: string
enabled: false
name: string
priority: 0
routerId: 0
sourceNetwork: string
translatedNetwork: string
translatedPorts: 0
vmaasRouterNatRuleId: string
VmaasRouterNatRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The VmaasRouterNatRule resource accepts the following input properties:
- Config
Vmaas
Router Nat Rule Config - NAT configurations
- Router
Id double - Parent router ID, router_id can be obtained by using router datasource/resource.
- Translated
Network string - Translated Network CIDR/IPv4 Address
- Description string
- Description for the NAT rule.
- Destination
Network string - Destination Network CIDR/IPv4 Address
- Enabled bool
- If
true
then NAT rule will be active/enabled. - Name string
- Name of the NAT rule.
- Priority double
- Priority for the rule
- Source
Network string - Source Network CIDR/IPv4 Address
- Translated
Ports double - Translated Network Port
- Vmaas
Router stringNat Rule Id - The ID of this resource.
- Config
Vmaas
Router Nat Rule Config Args - NAT configurations
- Router
Id float64 - Parent router ID, router_id can be obtained by using router datasource/resource.
- Translated
Network string - Translated Network CIDR/IPv4 Address
- Description string
- Description for the NAT rule.
- Destination
Network string - Destination Network CIDR/IPv4 Address
- Enabled bool
- If
true
then NAT rule will be active/enabled. - Name string
- Name of the NAT rule.
- Priority float64
- Priority for the rule
- Source
Network string - Source Network CIDR/IPv4 Address
- Translated
Ports float64 - Translated Network Port
- Vmaas
Router stringNat Rule Id - The ID of this resource.
- config
Vmaas
Router Nat Rule Config - NAT configurations
- router
Id Double - Parent router ID, router_id can be obtained by using router datasource/resource.
- translated
Network String - Translated Network CIDR/IPv4 Address
- description String
- Description for the NAT rule.
- destination
Network String - Destination Network CIDR/IPv4 Address
- enabled Boolean
- If
true
then NAT rule will be active/enabled. - name String
- Name of the NAT rule.
- priority Double
- Priority for the rule
- source
Network String - Source Network CIDR/IPv4 Address
- translated
Ports Double - Translated Network Port
- vmaas
Router StringNat Rule Id - The ID of this resource.
- config
Vmaas
Router Nat Rule Config - NAT configurations
- router
Id number - Parent router ID, router_id can be obtained by using router datasource/resource.
- translated
Network string - Translated Network CIDR/IPv4 Address
- description string
- Description for the NAT rule.
- destination
Network string - Destination Network CIDR/IPv4 Address
- enabled boolean
- If
true
then NAT rule will be active/enabled. - name string
- Name of the NAT rule.
- priority number
- Priority for the rule
- source
Network string - Source Network CIDR/IPv4 Address
- translated
Ports number - Translated Network Port
- vmaas
Router stringNat Rule Id - The ID of this resource.
- config
Vmaas
Router Nat Rule Config Args - NAT configurations
- router_
id float - Parent router ID, router_id can be obtained by using router datasource/resource.
- translated_
network str - Translated Network CIDR/IPv4 Address
- description str
- Description for the NAT rule.
- destination_
network str - Destination Network CIDR/IPv4 Address
- enabled bool
- If
true
then NAT rule will be active/enabled. - name str
- Name of the NAT rule.
- priority float
- Priority for the rule
- source_
network str - Source Network CIDR/IPv4 Address
- translated_
ports float - Translated Network Port
- vmaas_
router_ strnat_ rule_ id - The ID of this resource.
- config Property Map
- NAT configurations
- router
Id Number - Parent router ID, router_id can be obtained by using router datasource/resource.
- translated
Network String - Translated Network CIDR/IPv4 Address
- description String
- Description for the NAT rule.
- destination
Network String - Destination Network CIDR/IPv4 Address
- enabled Boolean
- If
true
then NAT rule will be active/enabled. - name String
- Name of the NAT rule.
- priority Number
- Priority for the rule
- source
Network String - Source Network CIDR/IPv4 Address
- translated
Ports Number - Translated Network Port
- vmaas
Router StringNat Rule Id - The ID of this resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the VmaasRouterNatRule resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing VmaasRouterNatRule Resource
Get an existing VmaasRouterNatRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: VmaasRouterNatRuleState, opts?: CustomResourceOptions): VmaasRouterNatRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
config: Optional[VmaasRouterNatRuleConfigArgs] = None,
description: Optional[str] = None,
destination_network: Optional[str] = None,
enabled: Optional[bool] = None,
name: Optional[str] = None,
priority: Optional[float] = None,
router_id: Optional[float] = None,
source_network: Optional[str] = None,
translated_network: Optional[str] = None,
translated_ports: Optional[float] = None,
vmaas_router_nat_rule_id: Optional[str] = None) -> VmaasRouterNatRule
func GetVmaasRouterNatRule(ctx *Context, name string, id IDInput, state *VmaasRouterNatRuleState, opts ...ResourceOption) (*VmaasRouterNatRule, error)
public static VmaasRouterNatRule Get(string name, Input<string> id, VmaasRouterNatRuleState? state, CustomResourceOptions? opts = null)
public static VmaasRouterNatRule get(String name, Output<String> id, VmaasRouterNatRuleState state, CustomResourceOptions options)
resources: _: type: hpegl:VmaasRouterNatRule get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Config
Vmaas
Router Nat Rule Config - NAT configurations
- Description string
- Description for the NAT rule.
- Destination
Network string - Destination Network CIDR/IPv4 Address
- Enabled bool
- If
true
then NAT rule will be active/enabled. - Name string
- Name of the NAT rule.
- Priority double
- Priority for the rule
- Router
Id double - Parent router ID, router_id can be obtained by using router datasource/resource.
- Source
Network string - Source Network CIDR/IPv4 Address
- Translated
Network string - Translated Network CIDR/IPv4 Address
- Translated
Ports double - Translated Network Port
- Vmaas
Router stringNat Rule Id - The ID of this resource.
- Config
Vmaas
Router Nat Rule Config Args - NAT configurations
- Description string
- Description for the NAT rule.
- Destination
Network string - Destination Network CIDR/IPv4 Address
- Enabled bool
- If
true
then NAT rule will be active/enabled. - Name string
- Name of the NAT rule.
- Priority float64
- Priority for the rule
- Router
Id float64 - Parent router ID, router_id can be obtained by using router datasource/resource.
- Source
Network string - Source Network CIDR/IPv4 Address
- Translated
Network string - Translated Network CIDR/IPv4 Address
- Translated
Ports float64 - Translated Network Port
- Vmaas
Router stringNat Rule Id - The ID of this resource.
- config
Vmaas
Router Nat Rule Config - NAT configurations
- description String
- Description for the NAT rule.
- destination
Network String - Destination Network CIDR/IPv4 Address
- enabled Boolean
- If
true
then NAT rule will be active/enabled. - name String
- Name of the NAT rule.
- priority Double
- Priority for the rule
- router
Id Double - Parent router ID, router_id can be obtained by using router datasource/resource.
- source
Network String - Source Network CIDR/IPv4 Address
- translated
Network String - Translated Network CIDR/IPv4 Address
- translated
Ports Double - Translated Network Port
- vmaas
Router StringNat Rule Id - The ID of this resource.
- config
Vmaas
Router Nat Rule Config - NAT configurations
- description string
- Description for the NAT rule.
- destination
Network string - Destination Network CIDR/IPv4 Address
- enabled boolean
- If
true
then NAT rule will be active/enabled. - name string
- Name of the NAT rule.
- priority number
- Priority for the rule
- router
Id number - Parent router ID, router_id can be obtained by using router datasource/resource.
- source
Network string - Source Network CIDR/IPv4 Address
- translated
Network string - Translated Network CIDR/IPv4 Address
- translated
Ports number - Translated Network Port
- vmaas
Router stringNat Rule Id - The ID of this resource.
- config
Vmaas
Router Nat Rule Config Args - NAT configurations
- description str
- Description for the NAT rule.
- destination_
network str - Destination Network CIDR/IPv4 Address
- enabled bool
- If
true
then NAT rule will be active/enabled. - name str
- Name of the NAT rule.
- priority float
- Priority for the rule
- router_
id float - Parent router ID, router_id can be obtained by using router datasource/resource.
- source_
network str - Source Network CIDR/IPv4 Address
- translated_
network str - Translated Network CIDR/IPv4 Address
- translated_
ports float - Translated Network Port
- vmaas_
router_ strnat_ rule_ id - The ID of this resource.
- config Property Map
- NAT configurations
- description String
- Description for the NAT rule.
- destination
Network String - Destination Network CIDR/IPv4 Address
- enabled Boolean
- If
true
then NAT rule will be active/enabled. - name String
- Name of the NAT rule.
- priority Number
- Priority for the rule
- router
Id Number - Parent router ID, router_id can be obtained by using router datasource/resource.
- source
Network String - Source Network CIDR/IPv4 Address
- translated
Network String - Translated Network CIDR/IPv4 Address
- translated
Ports Number - Translated Network Port
- vmaas
Router StringNat Rule Id - The ID of this resource.
Supporting Types
VmaasRouterNatRuleConfig, VmaasRouterNatRuleConfigArgs
Package Details
- Repository
- hpegl hpe/terraform-provider-hpegl
- License
- Notes
- This Pulumi package is based on the
hpegl
Terraform Provider.