1. Packages
  2. Avi Provider
  3. API Docs
  4. getNatpolicy
avi 31.1.1 published on Monday, Apr 14, 2025 by vmware

avi.getNatpolicy

Explore with Pulumi AI

avi logo
avi 31.1.1 published on Monday, Apr 14, 2025 by vmware

    <!–

    Copyright 2021 VMware, Inc.
    SPDX-License-Identifier: Mozilla Public License 2.0
    

    –>

    layout: “avi”

    page_title: “AVI: avi.Natpolicy” sidebar_current: “docs-avi-datasource-natpolicy” description: |- Get information of Avi NatPolicy.

    avi.Natpolicy

    This data source is used to to get avi.Natpolicy objects.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as avi from "@pulumi/avi";
    
    const fooNatpolicy = avi.getNatpolicy({
        name: "foo",
        uuid: "natpolicy-f9cf6b3e-a411-436f-95e2-2982ba2b217b",
    });
    
    import pulumi
    import pulumi_avi as avi
    
    foo_natpolicy = avi.get_natpolicy(name="foo",
        uuid="natpolicy-f9cf6b3e-a411-436f-95e2-2982ba2b217b")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/avi/v31/avi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := avi.LookupNatpolicy(ctx, &avi.LookupNatpolicyArgs{
    			Name: pulumi.StringRef("foo"),
    			Uuid: pulumi.StringRef("natpolicy-f9cf6b3e-a411-436f-95e2-2982ba2b217b"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Avi = Pulumi.Avi;
    
    return await Deployment.RunAsync(() => 
    {
        var fooNatpolicy = Avi.GetNatpolicy.Invoke(new()
        {
            Name = "foo",
            Uuid = "natpolicy-f9cf6b3e-a411-436f-95e2-2982ba2b217b",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.avi.AviFunctions;
    import com.pulumi.avi.inputs.GetNatpolicyArgs;
    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 fooNatpolicy = AviFunctions.getNatpolicy(GetNatpolicyArgs.builder()
                .name("foo")
                .uuid("natpolicy-f9cf6b3e-a411-436f-95e2-2982ba2b217b")
                .build());
    
        }
    }
    
    variables:
      fooNatpolicy:
        fn::invoke:
          function: avi:getNatpolicy
          arguments:
            name: foo
            uuid: natpolicy-f9cf6b3e-a411-436f-95e2-2982ba2b217b
    

    Using getNatpolicy

    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 getNatpolicy(args: GetNatpolicyArgs, opts?: InvokeOptions): Promise<GetNatpolicyResult>
    function getNatpolicyOutput(args: GetNatpolicyOutputArgs, opts?: InvokeOptions): Output<GetNatpolicyResult>
    def get_natpolicy(id: Optional[str] = None,
                      name: Optional[str] = None,
                      tenant_ref: Optional[str] = None,
                      uuid: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetNatpolicyResult
    def get_natpolicy_output(id: Optional[pulumi.Input[str]] = None,
                      name: Optional[pulumi.Input[str]] = None,
                      tenant_ref: Optional[pulumi.Input[str]] = None,
                      uuid: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetNatpolicyResult]
    func LookupNatpolicy(ctx *Context, args *LookupNatpolicyArgs, opts ...InvokeOption) (*LookupNatpolicyResult, error)
    func LookupNatpolicyOutput(ctx *Context, args *LookupNatpolicyOutputArgs, opts ...InvokeOption) LookupNatpolicyResultOutput

    > Note: This function is named LookupNatpolicy in the Go SDK.

    public static class GetNatpolicy 
    {
        public static Task<GetNatpolicyResult> InvokeAsync(GetNatpolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetNatpolicyResult> Invoke(GetNatpolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNatpolicyResult> getNatpolicy(GetNatpolicyArgs args, InvokeOptions options)
    public static Output<GetNatpolicyResult> getNatpolicy(GetNatpolicyArgs args, InvokeOptions options)
    
    fn::invoke:
      function: avi:index/getNatpolicy:getNatpolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    Name string
    Search NatPolicy by name.
    TenantRef string
    It is a reference to an object of type tenant. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Uuid string
    Search NatPolicy by uuid.
    Id string
    Name string
    Search NatPolicy by name.
    TenantRef string
    It is a reference to an object of type tenant. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Uuid string
    Search NatPolicy by uuid.
    id String
    name String
    Search NatPolicy by name.
    tenantRef String
    It is a reference to an object of type tenant. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    uuid String
    Search NatPolicy by uuid.
    id string
    name string
    Search NatPolicy by name.
    tenantRef string
    It is a reference to an object of type tenant. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    uuid string
    Search NatPolicy by uuid.
    id str
    name str
    Search NatPolicy by name.
    tenant_ref str
    It is a reference to an object of type tenant. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    uuid str
    Search NatPolicy by uuid.
    id String
    name String
    Search NatPolicy by name.
    tenantRef String
    It is a reference to an object of type tenant. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    uuid String
    Search NatPolicy by uuid.

    getNatpolicy Result

    The following output properties are available:

    ConfigpbAttributes List<GetNatpolicyConfigpbAttribute>
    Protobuf versioning for config pbs. Field introduced in 21.1.1. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    CreatedBy string
    Creator name. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Description string
    Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Id string
    Markers List<GetNatpolicyMarker>
    List of labels to be used for granular rbac. Field introduced in 20.1.5. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Name string
    Name of the nat policy. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Rules List<GetNatpolicyRule>
    Nat policy rules. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    TenantRef string
    It is a reference to an object of type tenant. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Uuid string
    Uuid of the nat policy. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    ConfigpbAttributes []GetNatpolicyConfigpbAttribute
    Protobuf versioning for config pbs. Field introduced in 21.1.1. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    CreatedBy string
    Creator name. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Description string
    Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Id string
    Markers []GetNatpolicyMarker
    List of labels to be used for granular rbac. Field introduced in 20.1.5. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Name string
    Name of the nat policy. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Rules []GetNatpolicyRule
    Nat policy rules. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    TenantRef string
    It is a reference to an object of type tenant. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Uuid string
    Uuid of the nat policy. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    configpbAttributes List<GetNatpolicyConfigpbAttribute>
    Protobuf versioning for config pbs. Field introduced in 21.1.1. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    createdBy String
    Creator name. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    description String
    Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    id String
    markers List<GetNatpolicyMarker>
    List of labels to be used for granular rbac. Field introduced in 20.1.5. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    name String
    Name of the nat policy. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    rules List<GetNatpolicyRule>
    Nat policy rules. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    tenantRef String
    It is a reference to an object of type tenant. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    uuid String
    Uuid of the nat policy. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    configpbAttributes GetNatpolicyConfigpbAttribute[]
    Protobuf versioning for config pbs. Field introduced in 21.1.1. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    createdBy string
    Creator name. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    description string
    Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    id string
    markers GetNatpolicyMarker[]
    List of labels to be used for granular rbac. Field introduced in 20.1.5. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    name string
    Name of the nat policy. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    rules GetNatpolicyRule[]
    Nat policy rules. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    tenantRef string
    It is a reference to an object of type tenant. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    uuid string
    Uuid of the nat policy. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    configpb_attributes Sequence[GetNatpolicyConfigpbAttribute]
    Protobuf versioning for config pbs. Field introduced in 21.1.1. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    created_by str
    Creator name. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    description str
    Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    id str
    markers Sequence[GetNatpolicyMarker]
    List of labels to be used for granular rbac. Field introduced in 20.1.5. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    name str
    Name of the nat policy. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    rules Sequence[GetNatpolicyRule]
    Nat policy rules. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    tenant_ref str
    It is a reference to an object of type tenant. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    uuid str
    Uuid of the nat policy. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    configpbAttributes List<Property Map>
    Protobuf versioning for config pbs. Field introduced in 21.1.1. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    createdBy String
    Creator name. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    description String
    Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    id String
    markers List<Property Map>
    List of labels to be used for granular rbac. Field introduced in 20.1.5. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    name String
    Name of the nat policy. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    rules List<Property Map>
    Nat policy rules. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    tenantRef String
    It is a reference to an object of type tenant. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    uuid String
    Uuid of the nat policy. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.

    Supporting Types

    GetNatpolicyConfigpbAttribute

    Version string
    Version string
    version String
    version string
    version String

    GetNatpolicyMarker

    Key string
    Values List<string>
    Key string
    Values []string
    key String
    values List<String>
    key string
    values string[]
    key str
    values Sequence[str]
    key String
    values List<String>

    GetNatpolicyRule

    Actions List<GetNatpolicyRuleAction>
    CreatedBy string
    Creator name. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Enable string
    Index string
    Matches List<GetNatpolicyRuleMatch>
    Name string
    Search NatPolicy by name.
    Actions []GetNatpolicyRuleAction
    CreatedBy string
    Creator name. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Enable string
    Index string
    Matches []GetNatpolicyRuleMatch
    Name string
    Search NatPolicy by name.
    actions List<GetNatpolicyRuleAction>
    createdBy String
    Creator name. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    enable String
    index String
    matches List<GetNatpolicyRuleMatch>
    name String
    Search NatPolicy by name.
    actions GetNatpolicyRuleAction[]
    createdBy string
    Creator name. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    enable string
    index string
    matches GetNatpolicyRuleMatch[]
    name string
    Search NatPolicy by name.
    actions Sequence[GetNatpolicyRuleAction]
    created_by str
    Creator name. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    enable str
    index str
    matches Sequence[GetNatpolicyRuleMatch]
    name str
    Search NatPolicy by name.
    actions List<Property Map>
    createdBy String
    Creator name. Field introduced in 18.2.3. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    enable String
    index String
    matches List<Property Map>
    name String
    Search NatPolicy by name.

    GetNatpolicyRuleAction

    GetNatpolicyRuleActionNatInfo

    GetNatpolicyRuleActionNatInfoNatIp

    Addr string
    Type string
    Addr string
    Type string
    addr String
    type String
    addr string
    type string
    addr str
    type str
    addr String
    type String

    GetNatpolicyRuleActionNatInfoNatIpRange

    GetNatpolicyRuleActionNatInfoNatIpRangeBegin

    Addr string
    Type string
    Addr string
    Type string
    addr String
    type String
    addr string
    type string
    addr str
    type str
    addr String
    type String

    GetNatpolicyRuleActionNatInfoNatIpRangeEnd

    Addr string
    Type string
    Addr string
    Type string
    addr String
    type String
    addr string
    type string
    addr str
    type str
    addr String
    type String

    GetNatpolicyRuleMatch

    GetNatpolicyRuleMatchDestinationIp

    GetNatpolicyRuleMatchDestinationIpAddr

    Addr string
    Type string
    Addr string
    Type string
    addr String
    type String
    addr string
    type string
    addr str
    type str
    addr String
    type String

    GetNatpolicyRuleMatchDestinationIpPrefix

    GetNatpolicyRuleMatchDestinationIpPrefixIpAddr

    Addr string
    Type string
    Addr string
    Type string
    addr String
    type String
    addr string
    type string
    addr str
    type str
    addr String
    type String

    GetNatpolicyRuleMatchDestinationIpRange

    GetNatpolicyRuleMatchDestinationIpRangeBegin

    Addr string
    Type string
    Addr string
    Type string
    addr String
    type String
    addr string
    type string
    addr str
    type str
    addr String
    type String

    GetNatpolicyRuleMatchDestinationIpRangeEnd

    Addr string
    Type string
    Addr string
    Type string
    addr String
    type String
    addr string
    type string
    addr str
    type str
    addr String
    type String

    GetNatpolicyRuleMatchService

    GetNatpolicyRuleMatchServiceDestinationPort

    MatchCriteria string
    Ports List<double>
    MatchCriteria string
    Ports []float64
    matchCriteria String
    ports List<Double>
    matchCriteria string
    ports number[]
    match_criteria str
    ports Sequence[float]
    matchCriteria String
    ports List<Number>

    GetNatpolicyRuleMatchServiceProtocol

    MatchCriteria string
    Protocol string
    MatchCriteria string
    Protocol string
    matchCriteria String
    protocol String
    matchCriteria string
    protocol string
    matchCriteria String
    protocol String

    GetNatpolicyRuleMatchServiceSourcePort

    MatchCriteria string
    Ports List<double>
    MatchCriteria string
    Ports []float64
    matchCriteria String
    ports List<Double>
    matchCriteria string
    ports number[]
    match_criteria str
    ports Sequence[float]
    matchCriteria String
    ports List<Number>

    GetNatpolicyRuleMatchSourceIp

    GetNatpolicyRuleMatchSourceIpAddr

    Addr string
    Type string
    Addr string
    Type string
    addr String
    type String
    addr string
    type string
    addr str
    type str
    addr String
    type String

    GetNatpolicyRuleMatchSourceIpPrefix

    GetNatpolicyRuleMatchSourceIpPrefixIpAddr

    Addr string
    Type string
    Addr string
    Type string
    addr String
    type String
    addr string
    type string
    addr str
    type str
    addr String
    type String

    GetNatpolicyRuleMatchSourceIpRange

    GetNatpolicyRuleMatchSourceIpRangeBegin

    Addr string
    Type string
    Addr string
    Type string
    addr String
    type String
    addr string
    type string
    addr str
    type str
    addr String
    type String

    GetNatpolicyRuleMatchSourceIpRangeEnd

    Addr string
    Type string
    Addr string
    Type string
    addr String
    type String
    addr string
    type string
    addr str
    type str
    addr String
    type String

    Package Details

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