1. Packages
  2. OpenStack
  3. API Docs
  4. firewall
  5. getPolicy
OpenStack v3.15.1 published on Thursday, Feb 1, 2024 by Pulumi

openstack.firewall.getPolicy

Explore with Pulumi AI

openstack logo
OpenStack v3.15.1 published on Thursday, Feb 1, 2024 by Pulumi

    Use this data source to get firewall policy information of an available OpenStack firewall policy.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using OpenStack = Pulumi.OpenStack;
    
    return await Deployment.RunAsync(() => 
    {
        var policy = OpenStack.Firewall.GetPolicy.Invoke(new()
        {
            Name = "tf_test_policy",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-openstack/sdk/v3/go/openstack/firewall"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := firewall.LookupPolicy(ctx, &firewall.LookupPolicyArgs{
    			Name: pulumi.StringRef("tf_test_policy"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.openstack.firewall.FirewallFunctions;
    import com.pulumi.openstack.firewall.inputs.GetPolicyArgs;
    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 policy = FirewallFunctions.getPolicy(GetPolicyArgs.builder()
                .name("tf_test_policy")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_openstack as openstack
    
    policy = openstack.firewall.get_policy(name="tf_test_policy")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as openstack from "@pulumi/openstack";
    
    const policy = openstack.firewall.getPolicy({
        name: "tf_test_policy",
    });
    
    variables:
      policy:
        fn::invoke:
          Function: openstack:firewall:getPolicy
          Arguments:
            name: tf_test_policy
    

    Using getPolicy

    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 getPolicy(args: GetPolicyArgs, opts?: InvokeOptions): Promise<GetPolicyResult>
    function getPolicyOutput(args: GetPolicyOutputArgs, opts?: InvokeOptions): Output<GetPolicyResult>
    def get_policy(name: Optional[str] = None,
                   policy_id: Optional[str] = None,
                   region: Optional[str] = None,
                   tenant_id: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetPolicyResult
    def get_policy_output(name: Optional[pulumi.Input[str]] = None,
                   policy_id: Optional[pulumi.Input[str]] = None,
                   region: Optional[pulumi.Input[str]] = None,
                   tenant_id: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetPolicyResult]
    func LookupPolicy(ctx *Context, args *LookupPolicyArgs, opts ...InvokeOption) (*LookupPolicyResult, error)
    func LookupPolicyOutput(ctx *Context, args *LookupPolicyOutputArgs, opts ...InvokeOption) LookupPolicyResultOutput

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

    public static class GetPolicy 
    {
        public static Task<GetPolicyResult> InvokeAsync(GetPolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetPolicyResult> Invoke(GetPolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPolicyResult> getPolicy(GetPolicyArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: openstack:firewall/getPolicy:getPolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the firewall policy.
    PolicyId string
    The ID of the firewall policy.
    Region string
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve firewall policy ids. If omitted, the region argument of the provider is used.
    TenantId string
    The owner of the firewall policy.
    Name string
    The name of the firewall policy.
    PolicyId string
    The ID of the firewall policy.
    Region string
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve firewall policy ids. If omitted, the region argument of the provider is used.
    TenantId string
    The owner of the firewall policy.
    name String
    The name of the firewall policy.
    policyId String
    The ID of the firewall policy.
    region String
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve firewall policy ids. If omitted, the region argument of the provider is used.
    tenantId String
    The owner of the firewall policy.
    name string
    The name of the firewall policy.
    policyId string
    The ID of the firewall policy.
    region string
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve firewall policy ids. If omitted, the region argument of the provider is used.
    tenantId string
    The owner of the firewall policy.
    name str
    The name of the firewall policy.
    policy_id str
    The ID of the firewall policy.
    region str
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve firewall policy ids. If omitted, the region argument of the provider is used.
    tenant_id str
    The owner of the firewall policy.
    name String
    The name of the firewall policy.
    policyId String
    The ID of the firewall policy.
    region String
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve firewall policy ids. If omitted, the region argument of the provider is used.
    tenantId String
    The owner of the firewall policy.

    getPolicy Result

    The following output properties are available:

    Audited bool
    The audit status of the firewall policy.
    Description string
    The description of the firewall policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    Region string
    See Argument Reference above.
    Rules List<string>
    The array of one or more firewall rules that comprise the policy.
    Shared bool
    The sharing status of the firewall policy.
    TenantId string
    See Argument Reference above.
    Name string
    See Argument Reference above.
    PolicyId string
    See Argument Reference above.
    Audited bool
    The audit status of the firewall policy.
    Description string
    The description of the firewall policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    Region string
    See Argument Reference above.
    Rules []string
    The array of one or more firewall rules that comprise the policy.
    Shared bool
    The sharing status of the firewall policy.
    TenantId string
    See Argument Reference above.
    Name string
    See Argument Reference above.
    PolicyId string
    See Argument Reference above.
    audited Boolean
    The audit status of the firewall policy.
    description String
    The description of the firewall policy.
    id String
    The provider-assigned unique ID for this managed resource.
    region String
    See Argument Reference above.
    rules List<String>
    The array of one or more firewall rules that comprise the policy.
    shared Boolean
    The sharing status of the firewall policy.
    tenantId String
    See Argument Reference above.
    name String
    See Argument Reference above.
    policyId String
    See Argument Reference above.
    audited boolean
    The audit status of the firewall policy.
    description string
    The description of the firewall policy.
    id string
    The provider-assigned unique ID for this managed resource.
    region string
    See Argument Reference above.
    rules string[]
    The array of one or more firewall rules that comprise the policy.
    shared boolean
    The sharing status of the firewall policy.
    tenantId string
    See Argument Reference above.
    name string
    See Argument Reference above.
    policyId string
    See Argument Reference above.
    audited bool
    The audit status of the firewall policy.
    description str
    The description of the firewall policy.
    id str
    The provider-assigned unique ID for this managed resource.
    region str
    See Argument Reference above.
    rules Sequence[str]
    The array of one or more firewall rules that comprise the policy.
    shared bool
    The sharing status of the firewall policy.
    tenant_id str
    See Argument Reference above.
    name str
    See Argument Reference above.
    policy_id str
    See Argument Reference above.
    audited Boolean
    The audit status of the firewall policy.
    description String
    The description of the firewall policy.
    id String
    The provider-assigned unique ID for this managed resource.
    region String
    See Argument Reference above.
    rules List<String>
    The array of one or more firewall rules that comprise the policy.
    shared Boolean
    The sharing status of the firewall policy.
    tenantId String
    See Argument Reference above.
    name String
    See Argument Reference above.
    policyId String
    See Argument Reference above.

    Package Details

    Repository
    OpenStack pulumi/pulumi-openstack
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the openstack Terraform Provider.
    openstack logo
    OpenStack v3.15.1 published on Thursday, Feb 1, 2024 by Pulumi