1. Packages
  2. HashiCorp Consul
  3. API Docs
  4. getAclRole
Consul v3.11.2 published on Thursday, Mar 21, 2024 by Pulumi

consul.getAclRole

Explore with Pulumi AI

consul logo
Consul v3.11.2 published on Thursday, Mar 21, 2024 by Pulumi

    The consul.AclRole data source returns the information related to a Consul ACL Role.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as consul from "@pulumi/consul";
    
    const test = consul.getAclRole({
        name: "example-role",
    });
    export const consulAclRole = test.then(test => test.id);
    
    import pulumi
    import pulumi_consul as consul
    
    test = consul.get_acl_role(name="example-role")
    pulumi.export("consulAclRole", test.id)
    
    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 {
    		test, err := consul.LookupAclRole(ctx, &consul.LookupAclRoleArgs{
    			Name: "example-role",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("consulAclRole", test.Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Consul = Pulumi.Consul;
    
    return await Deployment.RunAsync(() => 
    {
        var test = Consul.GetAclRole.Invoke(new()
        {
            Name = "example-role",
        });
    
        return new Dictionary<string, object?>
        {
            ["consulAclRole"] = test.Apply(getAclRoleResult => getAclRoleResult.Id),
        };
    });
    
    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.GetAclRoleArgs;
    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 test = ConsulFunctions.getAclRole(GetAclRoleArgs.builder()
                .name("example-role")
                .build());
    
            ctx.export("consulAclRole", test.applyValue(getAclRoleResult -> getAclRoleResult.id()));
        }
    }
    
    variables:
      test:
        fn::invoke:
          Function: consul:getAclRole
          Arguments:
            name: example-role
    outputs:
      consulAclRole: ${test.id}
    

    Using getAclRole

    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 getAclRole(args: GetAclRoleArgs, opts?: InvokeOptions): Promise<GetAclRoleResult>
    function getAclRoleOutput(args: GetAclRoleOutputArgs, opts?: InvokeOptions): Output<GetAclRoleResult>
    def get_acl_role(name: Optional[str] = None,
                     namespace: Optional[str] = None,
                     partition: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetAclRoleResult
    def get_acl_role_output(name: Optional[pulumi.Input[str]] = None,
                     namespace: Optional[pulumi.Input[str]] = None,
                     partition: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetAclRoleResult]
    func LookupAclRole(ctx *Context, args *LookupAclRoleArgs, opts ...InvokeOption) (*LookupAclRoleResult, error)
    func LookupAclRoleOutput(ctx *Context, args *LookupAclRoleOutputArgs, opts ...InvokeOption) LookupAclRoleResultOutput

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

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

    The following arguments are supported:

    Name string
    Namespace string
    The namespace to lookup the role.
    Partition string
    The partition to lookup the role.
    Name string
    Namespace string
    The namespace to lookup the role.
    Partition string
    The partition to lookup the role.
    name String
    namespace String
    The namespace to lookup the role.
    partition String
    The partition to lookup the role.
    name string
    namespace string
    The namespace to lookup the role.
    partition string
    The partition to lookup the role.
    name str
    namespace str
    The namespace to lookup the role.
    partition str
    The partition to lookup the role.
    name String
    namespace String
    The namespace to lookup the role.
    partition String
    The partition to lookup the role.

    getAclRole Result

    The following output properties are available:

    Description string
    The description of the ACL Role.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the ACL Role.
    NodeIdentities List<GetAclRoleNodeIdentity>
    The list of node identities associated with the ACL Role.
    Policies List<GetAclRolePolicy>
    The list of policies associated with the ACL Role.
    ServiceIdentities List<GetAclRoleServiceIdentity>
    The list of service identities associated with the ACL Role.
    TemplatedPolicies List<GetAclRoleTemplatedPolicy>
    The list of templated policies that should be applied to the token.
    Namespace string
    The namespace to lookup the role.
    Partition string
    The partition to lookup the role.
    Description string
    The description of the ACL Role.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the ACL Role.
    NodeIdentities []GetAclRoleNodeIdentity
    The list of node identities associated with the ACL Role.
    Policies []GetAclRolePolicy
    The list of policies associated with the ACL Role.
    ServiceIdentities []GetAclRoleServiceIdentity
    The list of service identities associated with the ACL Role.
    TemplatedPolicies []GetAclRoleTemplatedPolicy
    The list of templated policies that should be applied to the token.
    Namespace string
    The namespace to lookup the role.
    Partition string
    The partition to lookup the role.
    description String
    The description of the ACL Role.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the ACL Role.
    nodeIdentities List<GetAclRoleNodeIdentity>
    The list of node identities associated with the ACL Role.
    policies List<GetAclRolePolicy>
    The list of policies associated with the ACL Role.
    serviceIdentities List<GetAclRoleServiceIdentity>
    The list of service identities associated with the ACL Role.
    templatedPolicies List<GetAclRoleTemplatedPolicy>
    The list of templated policies that should be applied to the token.
    namespace String
    The namespace to lookup the role.
    partition String
    The partition to lookup the role.
    description string
    The description of the ACL Role.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The name of the ACL Role.
    nodeIdentities GetAclRoleNodeIdentity[]
    The list of node identities associated with the ACL Role.
    policies GetAclRolePolicy[]
    The list of policies associated with the ACL Role.
    serviceIdentities GetAclRoleServiceIdentity[]
    The list of service identities associated with the ACL Role.
    templatedPolicies GetAclRoleTemplatedPolicy[]
    The list of templated policies that should be applied to the token.
    namespace string
    The namespace to lookup the role.
    partition string
    The partition to lookup the role.
    description str
    The description of the ACL Role.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The name of the ACL Role.
    node_identities Sequence[GetAclRoleNodeIdentity]
    The list of node identities associated with the ACL Role.
    policies Sequence[GetAclRolePolicy]
    The list of policies associated with the ACL Role.
    service_identities Sequence[GetAclRoleServiceIdentity]
    The list of service identities associated with the ACL Role.
    templated_policies Sequence[GetAclRoleTemplatedPolicy]
    The list of templated policies that should be applied to the token.
    namespace str
    The namespace to lookup the role.
    partition str
    The partition to lookup the role.
    description String
    The description of the ACL Role.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the ACL Role.
    nodeIdentities List<Property Map>
    The list of node identities associated with the ACL Role.
    policies List<Property Map>
    The list of policies associated with the ACL Role.
    serviceIdentities List<Property Map>
    The list of service identities associated with the ACL Role.
    templatedPolicies List<Property Map>
    The list of templated policies that should be applied to the token.
    namespace String
    The namespace to lookup the role.
    partition String
    The partition to lookup the role.

    Supporting Types

    GetAclRoleNodeIdentity

    Datacenter string
    Specifies the nodes datacenter. This will result in effective policy only being valid in that datacenter.
    NodeName string
    The name of the node.
    Datacenter string
    Specifies the nodes datacenter. This will result in effective policy only being valid in that datacenter.
    NodeName string
    The name of the node.
    datacenter String
    Specifies the nodes datacenter. This will result in effective policy only being valid in that datacenter.
    nodeName String
    The name of the node.
    datacenter string
    Specifies the nodes datacenter. This will result in effective policy only being valid in that datacenter.
    nodeName string
    The name of the node.
    datacenter str
    Specifies the nodes datacenter. This will result in effective policy only being valid in that datacenter.
    node_name str
    The name of the node.
    datacenter String
    Specifies the nodes datacenter. This will result in effective policy only being valid in that datacenter.
    nodeName String
    The name of the node.

    GetAclRolePolicy

    Id string
    The ID of the policy.
    Name string
    The name of the policy.
    Id string
    The ID of the policy.
    Name string
    The name of the policy.
    id String
    The ID of the policy.
    name String
    The name of the policy.
    id string
    The ID of the policy.
    name string
    The name of the policy.
    id str
    The ID of the policy.
    name str
    The name of the policy.
    id String
    The ID of the policy.
    name String
    The name of the policy.

    GetAclRoleServiceIdentity

    Datacenters List<string>
    Specifies the datacenters the effective policy is valid within.
    ServiceName string
    The name of the service.
    Datacenters []string
    Specifies the datacenters the effective policy is valid within.
    ServiceName string
    The name of the service.
    datacenters List<String>
    Specifies the datacenters the effective policy is valid within.
    serviceName String
    The name of the service.
    datacenters string[]
    Specifies the datacenters the effective policy is valid within.
    serviceName string
    The name of the service.
    datacenters Sequence[str]
    Specifies the datacenters the effective policy is valid within.
    service_name str
    The name of the service.
    datacenters List<String>
    Specifies the datacenters the effective policy is valid within.
    serviceName String
    The name of the service.

    GetAclRoleTemplatedPolicy

    Datacenters List<string>
    Specifies the datacenters the effective policy is valid within.
    TemplateName string
    The name of the templated policies.
    TemplateVariables List<GetAclRoleTemplatedPolicyTemplateVariable>
    The templated policy variables.
    Datacenters []string
    Specifies the datacenters the effective policy is valid within.
    TemplateName string
    The name of the templated policies.
    TemplateVariables []GetAclRoleTemplatedPolicyTemplateVariable
    The templated policy variables.
    datacenters List<String>
    Specifies the datacenters the effective policy is valid within.
    templateName String
    The name of the templated policies.
    templateVariables List<GetAclRoleTemplatedPolicyTemplateVariable>
    The templated policy variables.
    datacenters string[]
    Specifies the datacenters the effective policy is valid within.
    templateName string
    The name of the templated policies.
    templateVariables GetAclRoleTemplatedPolicyTemplateVariable[]
    The templated policy variables.
    datacenters Sequence[str]
    Specifies the datacenters the effective policy is valid within.
    template_name str
    The name of the templated policies.
    template_variables Sequence[GetAclRoleTemplatedPolicyTemplateVariable]
    The templated policy variables.
    datacenters List<String>
    Specifies the datacenters the effective policy is valid within.
    templateName String
    The name of the templated policies.
    templateVariables List<Property Map>
    The templated policy variables.

    GetAclRoleTemplatedPolicyTemplateVariable

    Name string
    The name of node, workload identity or service.
    Name string
    The name of node, workload identity or service.
    name String
    The name of node, workload identity or service.
    name string
    The name of node, workload identity or service.
    name str
    The name of node, workload identity or service.
    name String
    The name of node, workload identity or service.

    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.11.2 published on Thursday, Mar 21, 2024 by Pulumi