1. Packages
  2. Vcd Provider
  3. API Docs
  4. VappNatRules
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

vcd.VappNatRules

Explore with Pulumi AI

vcd logo
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

    Create VappNatRules Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new VappNatRules(name: string, args: VappNatRulesArgs, opts?: CustomResourceOptions);
    @overload
    def VappNatRules(resource_name: str,
                     args: VappNatRulesArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def VappNatRules(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     nat_type: Optional[str] = None,
                     network_id: Optional[str] = None,
                     vapp_id: Optional[str] = None,
                     enable_ip_masquerade: Optional[bool] = None,
                     enabled: Optional[bool] = None,
                     org: Optional[str] = None,
                     rules: Optional[Sequence[VappNatRulesRuleArgs]] = None,
                     vapp_nat_rules_id: Optional[str] = None,
                     vdc: Optional[str] = None)
    func NewVappNatRules(ctx *Context, name string, args VappNatRulesArgs, opts ...ResourceOption) (*VappNatRules, error)
    public VappNatRules(string name, VappNatRulesArgs args, CustomResourceOptions? opts = null)
    public VappNatRules(String name, VappNatRulesArgs args)
    public VappNatRules(String name, VappNatRulesArgs args, CustomResourceOptions options)
    
    type: vcd:VappNatRules
    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 VappNatRulesArgs
    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 VappNatRulesArgs
    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 VappNatRulesArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VappNatRulesArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VappNatRulesArgs
    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 vappNatRulesResource = new Vcd.VappNatRules("vappNatRulesResource", new()
    {
        NatType = "string",
        NetworkId = "string",
        VappId = "string",
        EnableIpMasquerade = false,
        Enabled = false,
        Org = "string",
        Rules = new[]
        {
            new Vcd.Inputs.VappNatRulesRuleArgs
            {
                VmId = "string",
                VmNicId = 0,
                ExternalIp = "string",
                ExternalPort = 0,
                ForwardToPort = 0,
                Id = "string",
                MappingMode = "string",
                Protocol = "string",
            },
        },
        VappNatRulesId = "string",
        Vdc = "string",
    });
    
    example, err := vcd.NewVappNatRules(ctx, "vappNatRulesResource", &vcd.VappNatRulesArgs{
    	NatType:            pulumi.String("string"),
    	NetworkId:          pulumi.String("string"),
    	VappId:             pulumi.String("string"),
    	EnableIpMasquerade: pulumi.Bool(false),
    	Enabled:            pulumi.Bool(false),
    	Org:                pulumi.String("string"),
    	Rules: vcd.VappNatRulesRuleArray{
    		&vcd.VappNatRulesRuleArgs{
    			VmId:          pulumi.String("string"),
    			VmNicId:       pulumi.Float64(0),
    			ExternalIp:    pulumi.String("string"),
    			ExternalPort:  pulumi.Float64(0),
    			ForwardToPort: pulumi.Float64(0),
    			Id:            pulumi.String("string"),
    			MappingMode:   pulumi.String("string"),
    			Protocol:      pulumi.String("string"),
    		},
    	},
    	VappNatRulesId: pulumi.String("string"),
    	Vdc:            pulumi.String("string"),
    })
    
    var vappNatRulesResource = new VappNatRules("vappNatRulesResource", VappNatRulesArgs.builder()
        .natType("string")
        .networkId("string")
        .vappId("string")
        .enableIpMasquerade(false)
        .enabled(false)
        .org("string")
        .rules(VappNatRulesRuleArgs.builder()
            .vmId("string")
            .vmNicId(0)
            .externalIp("string")
            .externalPort(0)
            .forwardToPort(0)
            .id("string")
            .mappingMode("string")
            .protocol("string")
            .build())
        .vappNatRulesId("string")
        .vdc("string")
        .build());
    
    vapp_nat_rules_resource = vcd.VappNatRules("vappNatRulesResource",
        nat_type="string",
        network_id="string",
        vapp_id="string",
        enable_ip_masquerade=False,
        enabled=False,
        org="string",
        rules=[{
            "vm_id": "string",
            "vm_nic_id": 0,
            "external_ip": "string",
            "external_port": 0,
            "forward_to_port": 0,
            "id": "string",
            "mapping_mode": "string",
            "protocol": "string",
        }],
        vapp_nat_rules_id="string",
        vdc="string")
    
    const vappNatRulesResource = new vcd.VappNatRules("vappNatRulesResource", {
        natType: "string",
        networkId: "string",
        vappId: "string",
        enableIpMasquerade: false,
        enabled: false,
        org: "string",
        rules: [{
            vmId: "string",
            vmNicId: 0,
            externalIp: "string",
            externalPort: 0,
            forwardToPort: 0,
            id: "string",
            mappingMode: "string",
            protocol: "string",
        }],
        vappNatRulesId: "string",
        vdc: "string",
    });
    
    type: vcd:VappNatRules
    properties:
        enableIpMasquerade: false
        enabled: false
        natType: string
        networkId: string
        org: string
        rules:
            - externalIp: string
              externalPort: 0
              forwardToPort: 0
              id: string
              mappingMode: string
              protocol: string
              vmId: string
              vmNicId: 0
        vappId: string
        vappNatRulesId: string
        vdc: string
    

    VappNatRules 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 VappNatRules resource accepts the following input properties:

    NatType string
    "One of: ipTranslation (use IP translation), portForwarding (use port forwarding). For ipTranslation fields vm_id, vm_nic_id, mapping_mode are required and external_ip is optional. For portForwarding fields vm_id, vm_nic_id, protocol, external_port and forward_to_port are required.
    NetworkId string
    The identifier of vApp network.
    VappId string
    The identifier of vApp.
    EnableIpMasquerade bool
    When enabled translates a virtual machine's private, internal IP address to a public IP address for outbound traffic. Default value is false.
    Enabled bool
    Enable or disable NAT. Default is true. To enable the NAT service, vcd.VappFirewallRules needs to be enabled as well.
    Org string
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
    Rules List<VappNatRulesRule>

    Configures a NAT rule; see Rules below for details.

    VappNatRulesId string
    Vdc string
    The name of VDC to use, optional if defined at provider level.
    NatType string
    "One of: ipTranslation (use IP translation), portForwarding (use port forwarding). For ipTranslation fields vm_id, vm_nic_id, mapping_mode are required and external_ip is optional. For portForwarding fields vm_id, vm_nic_id, protocol, external_port and forward_to_port are required.
    NetworkId string
    The identifier of vApp network.
    VappId string
    The identifier of vApp.
    EnableIpMasquerade bool
    When enabled translates a virtual machine's private, internal IP address to a public IP address for outbound traffic. Default value is false.
    Enabled bool
    Enable or disable NAT. Default is true. To enable the NAT service, vcd.VappFirewallRules needs to be enabled as well.
    Org string
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
    Rules []VappNatRulesRuleArgs

    Configures a NAT rule; see Rules below for details.

    VappNatRulesId string
    Vdc string
    The name of VDC to use, optional if defined at provider level.
    natType String
    "One of: ipTranslation (use IP translation), portForwarding (use port forwarding). For ipTranslation fields vm_id, vm_nic_id, mapping_mode are required and external_ip is optional. For portForwarding fields vm_id, vm_nic_id, protocol, external_port and forward_to_port are required.
    networkId String
    The identifier of vApp network.
    vappId String
    The identifier of vApp.
    enableIpMasquerade Boolean
    When enabled translates a virtual machine's private, internal IP address to a public IP address for outbound traffic. Default value is false.
    enabled Boolean
    Enable or disable NAT. Default is true. To enable the NAT service, vcd.VappFirewallRules needs to be enabled as well.
    org String
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
    rules List<VappNatRulesRule>

    Configures a NAT rule; see Rules below for details.

    vappNatRulesId String
    vdc String
    The name of VDC to use, optional if defined at provider level.
    natType string
    "One of: ipTranslation (use IP translation), portForwarding (use port forwarding). For ipTranslation fields vm_id, vm_nic_id, mapping_mode are required and external_ip is optional. For portForwarding fields vm_id, vm_nic_id, protocol, external_port and forward_to_port are required.
    networkId string
    The identifier of vApp network.
    vappId string
    The identifier of vApp.
    enableIpMasquerade boolean
    When enabled translates a virtual machine's private, internal IP address to a public IP address for outbound traffic. Default value is false.
    enabled boolean
    Enable or disable NAT. Default is true. To enable the NAT service, vcd.VappFirewallRules needs to be enabled as well.
    org string
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
    rules VappNatRulesRule[]

    Configures a NAT rule; see Rules below for details.

    vappNatRulesId string
    vdc string
    The name of VDC to use, optional if defined at provider level.
    nat_type str
    "One of: ipTranslation (use IP translation), portForwarding (use port forwarding). For ipTranslation fields vm_id, vm_nic_id, mapping_mode are required and external_ip is optional. For portForwarding fields vm_id, vm_nic_id, protocol, external_port and forward_to_port are required.
    network_id str
    The identifier of vApp network.
    vapp_id str
    The identifier of vApp.
    enable_ip_masquerade bool
    When enabled translates a virtual machine's private, internal IP address to a public IP address for outbound traffic. Default value is false.
    enabled bool
    Enable or disable NAT. Default is true. To enable the NAT service, vcd.VappFirewallRules needs to be enabled as well.
    org str
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
    rules Sequence[VappNatRulesRuleArgs]

    Configures a NAT rule; see Rules below for details.

    vapp_nat_rules_id str
    vdc str
    The name of VDC to use, optional if defined at provider level.
    natType String
    "One of: ipTranslation (use IP translation), portForwarding (use port forwarding). For ipTranslation fields vm_id, vm_nic_id, mapping_mode are required and external_ip is optional. For portForwarding fields vm_id, vm_nic_id, protocol, external_port and forward_to_port are required.
    networkId String
    The identifier of vApp network.
    vappId String
    The identifier of vApp.
    enableIpMasquerade Boolean
    When enabled translates a virtual machine's private, internal IP address to a public IP address for outbound traffic. Default value is false.
    enabled Boolean
    Enable or disable NAT. Default is true. To enable the NAT service, vcd.VappFirewallRules needs to be enabled as well.
    org String
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
    rules List<Property Map>

    Configures a NAT rule; see Rules below for details.

    vappNatRulesId String
    vdc String
    The name of VDC to use, optional if defined at provider level.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the VappNatRules 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 VappNatRules Resource

    Get an existing VappNatRules 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?: VappNatRulesState, opts?: CustomResourceOptions): VappNatRules
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            enable_ip_masquerade: Optional[bool] = None,
            enabled: Optional[bool] = None,
            nat_type: Optional[str] = None,
            network_id: Optional[str] = None,
            org: Optional[str] = None,
            rules: Optional[Sequence[VappNatRulesRuleArgs]] = None,
            vapp_id: Optional[str] = None,
            vapp_nat_rules_id: Optional[str] = None,
            vdc: Optional[str] = None) -> VappNatRules
    func GetVappNatRules(ctx *Context, name string, id IDInput, state *VappNatRulesState, opts ...ResourceOption) (*VappNatRules, error)
    public static VappNatRules Get(string name, Input<string> id, VappNatRulesState? state, CustomResourceOptions? opts = null)
    public static VappNatRules get(String name, Output<String> id, VappNatRulesState state, CustomResourceOptions options)
    resources:  _:    type: vcd:VappNatRules    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.
    The following state arguments are supported:
    EnableIpMasquerade bool
    When enabled translates a virtual machine's private, internal IP address to a public IP address for outbound traffic. Default value is false.
    Enabled bool
    Enable or disable NAT. Default is true. To enable the NAT service, vcd.VappFirewallRules needs to be enabled as well.
    NatType string
    "One of: ipTranslation (use IP translation), portForwarding (use port forwarding). For ipTranslation fields vm_id, vm_nic_id, mapping_mode are required and external_ip is optional. For portForwarding fields vm_id, vm_nic_id, protocol, external_port and forward_to_port are required.
    NetworkId string
    The identifier of vApp network.
    Org string
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
    Rules List<VappNatRulesRule>

    Configures a NAT rule; see Rules below for details.

    VappId string
    The identifier of vApp.
    VappNatRulesId string
    Vdc string
    The name of VDC to use, optional if defined at provider level.
    EnableIpMasquerade bool
    When enabled translates a virtual machine's private, internal IP address to a public IP address for outbound traffic. Default value is false.
    Enabled bool
    Enable or disable NAT. Default is true. To enable the NAT service, vcd.VappFirewallRules needs to be enabled as well.
    NatType string
    "One of: ipTranslation (use IP translation), portForwarding (use port forwarding). For ipTranslation fields vm_id, vm_nic_id, mapping_mode are required and external_ip is optional. For portForwarding fields vm_id, vm_nic_id, protocol, external_port and forward_to_port are required.
    NetworkId string
    The identifier of vApp network.
    Org string
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
    Rules []VappNatRulesRuleArgs

    Configures a NAT rule; see Rules below for details.

    VappId string
    The identifier of vApp.
    VappNatRulesId string
    Vdc string
    The name of VDC to use, optional if defined at provider level.
    enableIpMasquerade Boolean
    When enabled translates a virtual machine's private, internal IP address to a public IP address for outbound traffic. Default value is false.
    enabled Boolean
    Enable or disable NAT. Default is true. To enable the NAT service, vcd.VappFirewallRules needs to be enabled as well.
    natType String
    "One of: ipTranslation (use IP translation), portForwarding (use port forwarding). For ipTranslation fields vm_id, vm_nic_id, mapping_mode are required and external_ip is optional. For portForwarding fields vm_id, vm_nic_id, protocol, external_port and forward_to_port are required.
    networkId String
    The identifier of vApp network.
    org String
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
    rules List<VappNatRulesRule>

    Configures a NAT rule; see Rules below for details.

    vappId String
    The identifier of vApp.
    vappNatRulesId String
    vdc String
    The name of VDC to use, optional if defined at provider level.
    enableIpMasquerade boolean
    When enabled translates a virtual machine's private, internal IP address to a public IP address for outbound traffic. Default value is false.
    enabled boolean
    Enable or disable NAT. Default is true. To enable the NAT service, vcd.VappFirewallRules needs to be enabled as well.
    natType string
    "One of: ipTranslation (use IP translation), portForwarding (use port forwarding). For ipTranslation fields vm_id, vm_nic_id, mapping_mode are required and external_ip is optional. For portForwarding fields vm_id, vm_nic_id, protocol, external_port and forward_to_port are required.
    networkId string
    The identifier of vApp network.
    org string
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
    rules VappNatRulesRule[]

    Configures a NAT rule; see Rules below for details.

    vappId string
    The identifier of vApp.
    vappNatRulesId string
    vdc string
    The name of VDC to use, optional if defined at provider level.
    enable_ip_masquerade bool
    When enabled translates a virtual machine's private, internal IP address to a public IP address for outbound traffic. Default value is false.
    enabled bool
    Enable or disable NAT. Default is true. To enable the NAT service, vcd.VappFirewallRules needs to be enabled as well.
    nat_type str
    "One of: ipTranslation (use IP translation), portForwarding (use port forwarding). For ipTranslation fields vm_id, vm_nic_id, mapping_mode are required and external_ip is optional. For portForwarding fields vm_id, vm_nic_id, protocol, external_port and forward_to_port are required.
    network_id str
    The identifier of vApp network.
    org str
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
    rules Sequence[VappNatRulesRuleArgs]

    Configures a NAT rule; see Rules below for details.

    vapp_id str
    The identifier of vApp.
    vapp_nat_rules_id str
    vdc str
    The name of VDC to use, optional if defined at provider level.
    enableIpMasquerade Boolean
    When enabled translates a virtual machine's private, internal IP address to a public IP address for outbound traffic. Default value is false.
    enabled Boolean
    Enable or disable NAT. Default is true. To enable the NAT service, vcd.VappFirewallRules needs to be enabled as well.
    natType String
    "One of: ipTranslation (use IP translation), portForwarding (use port forwarding). For ipTranslation fields vm_id, vm_nic_id, mapping_mode are required and external_ip is optional. For portForwarding fields vm_id, vm_nic_id, protocol, external_port and forward_to_port are required.
    networkId String
    The identifier of vApp network.
    org String
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
    rules List<Property Map>

    Configures a NAT rule; see Rules below for details.

    vappId String
    The identifier of vApp.
    vappNatRulesId String
    vdc String
    The name of VDC to use, optional if defined at provider level.

    Supporting Types

    VappNatRulesRule, VappNatRulesRuleArgs

    VmId string
    VM to which this rule applies.
    VmNicId double
    VM NIC ID to which this rule applies.
    ExternalIp string
    External IP address to forward to or External IP address to map to VM
    ExternalPort double
    External port to forward.
    ForwardToPort double
    Internal port to forward.
    Id string
    ID of the rule. Can be used to track syslog messages.
    MappingMode string
    Mapping mode. One of: automatic, manual
    Protocol string
    Protocol to forward. One of: TCP (forward TCP packets), UDP (forward UDP packets), TCP_UDP (forward TCP and UDP packets).
    VmId string
    VM to which this rule applies.
    VmNicId float64
    VM NIC ID to which this rule applies.
    ExternalIp string
    External IP address to forward to or External IP address to map to VM
    ExternalPort float64
    External port to forward.
    ForwardToPort float64
    Internal port to forward.
    Id string
    ID of the rule. Can be used to track syslog messages.
    MappingMode string
    Mapping mode. One of: automatic, manual
    Protocol string
    Protocol to forward. One of: TCP (forward TCP packets), UDP (forward UDP packets), TCP_UDP (forward TCP and UDP packets).
    vmId String
    VM to which this rule applies.
    vmNicId Double
    VM NIC ID to which this rule applies.
    externalIp String
    External IP address to forward to or External IP address to map to VM
    externalPort Double
    External port to forward.
    forwardToPort Double
    Internal port to forward.
    id String
    ID of the rule. Can be used to track syslog messages.
    mappingMode String
    Mapping mode. One of: automatic, manual
    protocol String
    Protocol to forward. One of: TCP (forward TCP packets), UDP (forward UDP packets), TCP_UDP (forward TCP and UDP packets).
    vmId string
    VM to which this rule applies.
    vmNicId number
    VM NIC ID to which this rule applies.
    externalIp string
    External IP address to forward to or External IP address to map to VM
    externalPort number
    External port to forward.
    forwardToPort number
    Internal port to forward.
    id string
    ID of the rule. Can be used to track syslog messages.
    mappingMode string
    Mapping mode. One of: automatic, manual
    protocol string
    Protocol to forward. One of: TCP (forward TCP packets), UDP (forward UDP packets), TCP_UDP (forward TCP and UDP packets).
    vm_id str
    VM to which this rule applies.
    vm_nic_id float
    VM NIC ID to which this rule applies.
    external_ip str
    External IP address to forward to or External IP address to map to VM
    external_port float
    External port to forward.
    forward_to_port float
    Internal port to forward.
    id str
    ID of the rule. Can be used to track syslog messages.
    mapping_mode str
    Mapping mode. One of: automatic, manual
    protocol str
    Protocol to forward. One of: TCP (forward TCP packets), UDP (forward UDP packets), TCP_UDP (forward TCP and UDP packets).
    vmId String
    VM to which this rule applies.
    vmNicId Number
    VM NIC ID to which this rule applies.
    externalIp String
    External IP address to forward to or External IP address to map to VM
    externalPort Number
    External port to forward.
    forwardToPort Number
    Internal port to forward.
    id String
    ID of the rule. Can be used to track syslog messages.
    mappingMode String
    Mapping mode. One of: automatic, manual
    protocol String
    Protocol to forward. One of: TCP (forward TCP packets), UDP (forward UDP packets), TCP_UDP (forward TCP and UDP packets).

    Package Details

    Repository
    vcd vmware/terraform-provider-vcd
    License
    Notes
    This Pulumi package is based on the vcd Terraform Provider.
    vcd logo
    vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware