1. Packages
  2. Consul Provider
  3. API Docs
  4. getAclPolicy
Consul v3.12.2 published on Wednesday, Oct 16, 2024 by Pulumi

consul.getAclPolicy

Explore with Pulumi AI

consul logo
Consul v3.12.2 published on Wednesday, Oct 16, 2024 by Pulumi

    The consul.AclPolicy data source returns the information related to a Consul ACL Policy.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as consul from "@pulumi/consul";
    
    const agent = consul.getAclPolicy({
        name: "agent",
    });
    export const consulAclPolicy = agent.then(agent => agent.rules);
    
    import pulumi
    import pulumi_consul as consul
    
    agent = consul.get_acl_policy(name="agent")
    pulumi.export("consulAclPolicy", agent.rules)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-consul/sdk/v3/go/consul"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		agent, err := consul.LookupAclPolicy(ctx, &consul.LookupAclPolicyArgs{
    			Name: "agent",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("consulAclPolicy", agent.Rules)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Consul = Pulumi.Consul;
    
    return await Deployment.RunAsync(() => 
    {
        var agent = Consul.GetAclPolicy.Invoke(new()
        {
            Name = "agent",
        });
    
        return new Dictionary<string, object?>
        {
            ["consulAclPolicy"] = agent.Apply(getAclPolicyResult => getAclPolicyResult.Rules),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.consul.ConsulFunctions;
    import com.pulumi.consul.inputs.GetAclPolicyArgs;
    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 agent = ConsulFunctions.getAclPolicy(GetAclPolicyArgs.builder()
                .name("agent")
                .build());
    
            ctx.export("consulAclPolicy", agent.applyValue(getAclPolicyResult -> getAclPolicyResult.rules()));
        }
    }
    
    variables:
      agent:
        fn::invoke:
          Function: consul:getAclPolicy
          Arguments:
            name: agent
    outputs:
      consulAclPolicy: ${agent.rules}
    

    Using getAclPolicy

    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 getAclPolicy(args: GetAclPolicyArgs, opts?: InvokeOptions): Promise<GetAclPolicyResult>
    function getAclPolicyOutput(args: GetAclPolicyOutputArgs, opts?: InvokeOptions): Output<GetAclPolicyResult>
    def get_acl_policy(name: Optional[str] = None,
                       namespace: Optional[str] = None,
                       partition: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetAclPolicyResult
    def get_acl_policy_output(name: Optional[pulumi.Input[str]] = None,
                       namespace: Optional[pulumi.Input[str]] = None,
                       partition: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetAclPolicyResult]
    func LookupAclPolicy(ctx *Context, args *LookupAclPolicyArgs, opts ...InvokeOption) (*LookupAclPolicyResult, error)
    func LookupAclPolicyOutput(ctx *Context, args *LookupAclPolicyOutputArgs, opts ...InvokeOption) LookupAclPolicyResultOutput

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

    public static class GetAclPolicy 
    {
        public static Task<GetAclPolicyResult> InvokeAsync(GetAclPolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetAclPolicyResult> Invoke(GetAclPolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAclPolicyResult> getAclPolicy(GetAclPolicyArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: consul:index/getAclPolicy:getAclPolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the ACL Policy.
    Namespace string
    The namespace to lookup the policy.
    Partition string
    The partition to lookup the policy.
    Name string
    The name of the ACL Policy.
    Namespace string
    The namespace to lookup the policy.
    Partition string
    The partition to lookup the policy.
    name String
    The name of the ACL Policy.
    namespace String
    The namespace to lookup the policy.
    partition String
    The partition to lookup the policy.
    name string
    The name of the ACL Policy.
    namespace string
    The namespace to lookup the policy.
    partition string
    The partition to lookup the policy.
    name str
    The name of the ACL Policy.
    namespace str
    The namespace to lookup the policy.
    partition str
    The partition to lookup the policy.
    name String
    The name of the ACL Policy.
    namespace String
    The namespace to lookup the policy.
    partition String
    The partition to lookup the policy.

    getAclPolicy Result

    The following output properties are available:

    Datacenters List<string>
    The datacenters associated with the ACL Policy.
    Description string
    The description of the ACL Policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Rules string
    The rules associated with the ACL Policy.
    Namespace string
    Partition string
    Datacenters []string
    The datacenters associated with the ACL Policy.
    Description string
    The description of the ACL Policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Rules string
    The rules associated with the ACL Policy.
    Namespace string
    Partition string
    datacenters List<String>
    The datacenters associated with the ACL Policy.
    description String
    The description of the ACL Policy.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    rules String
    The rules associated with the ACL Policy.
    namespace String
    partition String
    datacenters string[]
    The datacenters associated with the ACL Policy.
    description string
    The description of the ACL Policy.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    rules string
    The rules associated with the ACL Policy.
    namespace string
    partition string
    datacenters Sequence[str]
    The datacenters associated with the ACL Policy.
    description str
    The description of the ACL Policy.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    rules str
    The rules associated with the ACL Policy.
    namespace str
    partition str
    datacenters List<String>
    The datacenters associated with the ACL Policy.
    description String
    The description of the ACL Policy.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    rules String
    The rules associated with the ACL Policy.
    namespace String
    partition String

    Package Details

    Repository
    HashiCorp Consul pulumi/pulumi-consul
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the consul Terraform Provider.
    consul logo
    Consul v3.12.2 published on Wednesday, Oct 16, 2024 by Pulumi