1. Packages
  2. Azure Classic
  3. API Docs
  4. keyvault
  5. getAccessPolicy

We recommend using Azure Native.

Azure Classic v5.80.0 published on Monday, Jun 10, 2024 by Pulumi

azure.keyvault.getAccessPolicy

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.80.0 published on Monday, Jun 10, 2024 by Pulumi

    Use this data source to access information about the permissions from the Management Key Vault Templates.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const contributor = azure.keyvault.getAccessPolicy({
        name: "Key Management",
    });
    export const accessPolicyKeyPermissions = contributor.then(contributor => contributor.keyPermissions);
    
    import pulumi
    import pulumi_azure as azure
    
    contributor = azure.keyvault.get_access_policy(name="Key Management")
    pulumi.export("accessPolicyKeyPermissions", contributor.key_permissions)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		contributor, err := keyvault.LookupAccessPolicy(ctx, &keyvault.LookupAccessPolicyArgs{
    			Name: "Key Management",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("accessPolicyKeyPermissions", contributor.KeyPermissions)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var contributor = Azure.KeyVault.GetAccessPolicy.Invoke(new()
        {
            Name = "Key Management",
        });
    
        return new Dictionary<string, object?>
        {
            ["accessPolicyKeyPermissions"] = contributor.Apply(getAccessPolicyResult => getAccessPolicyResult.KeyPermissions),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.keyvault.KeyvaultFunctions;
    import com.pulumi.azure.keyvault.inputs.GetAccessPolicyArgs;
    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 contributor = KeyvaultFunctions.getAccessPolicy(GetAccessPolicyArgs.builder()
                .name("Key Management")
                .build());
    
            ctx.export("accessPolicyKeyPermissions", contributor.applyValue(getAccessPolicyResult -> getAccessPolicyResult.keyPermissions()));
        }
    }
    
    variables:
      contributor:
        fn::invoke:
          Function: azure:keyvault:getAccessPolicy
          Arguments:
            name: Key Management
    outputs:
      accessPolicyKeyPermissions: ${contributor.keyPermissions}
    

    Using getAccessPolicy

    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 getAccessPolicy(args: GetAccessPolicyArgs, opts?: InvokeOptions): Promise<GetAccessPolicyResult>
    function getAccessPolicyOutput(args: GetAccessPolicyOutputArgs, opts?: InvokeOptions): Output<GetAccessPolicyResult>
    def get_access_policy(name: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetAccessPolicyResult
    def get_access_policy_output(name: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetAccessPolicyResult]
    func LookupAccessPolicy(ctx *Context, args *LookupAccessPolicyArgs, opts ...InvokeOption) (*LookupAccessPolicyResult, error)
    func LookupAccessPolicyOutput(ctx *Context, args *LookupAccessPolicyOutputArgs, opts ...InvokeOption) LookupAccessPolicyResultOutput

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

    public static class GetAccessPolicy 
    {
        public static Task<GetAccessPolicyResult> InvokeAsync(GetAccessPolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetAccessPolicyResult> Invoke(GetAccessPolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAccessPolicyResult> getAccessPolicy(GetAccessPolicyArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:keyvault/getAccessPolicy:getAccessPolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Specifies the name of the Management Template. Possible values are: Key Management, Secret Management, Certificate Management, Key & Secret Management, Key & Certificate Management, Secret & Certificate Management, Key, Secret, & Certificate Management
    Name string
    Specifies the name of the Management Template. Possible values are: Key Management, Secret Management, Certificate Management, Key & Secret Management, Key & Certificate Management, Secret & Certificate Management, Key, Secret, & Certificate Management
    name String
    Specifies the name of the Management Template. Possible values are: Key Management, Secret Management, Certificate Management, Key & Secret Management, Key & Certificate Management, Secret & Certificate Management, Key, Secret, & Certificate Management
    name string
    Specifies the name of the Management Template. Possible values are: Key Management, Secret Management, Certificate Management, Key & Secret Management, Key & Certificate Management, Secret & Certificate Management, Key, Secret, & Certificate Management
    name str
    Specifies the name of the Management Template. Possible values are: Key Management, Secret Management, Certificate Management, Key & Secret Management, Key & Certificate Management, Secret & Certificate Management, Key, Secret, & Certificate Management
    name String
    Specifies the name of the Management Template. Possible values are: Key Management, Secret Management, Certificate Management, Key & Secret Management, Key & Certificate Management, Secret & Certificate Management, Key, Secret, & Certificate Management

    getAccessPolicy Result

    The following output properties are available:

    CertificatePermissions List<string>
    the certificate permissions for the access policy
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyPermissions List<string>
    the key permissions for the access policy
    Name string
    SecretPermissions List<string>
    the secret permissions for the access policy
    CertificatePermissions []string
    the certificate permissions for the access policy
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyPermissions []string
    the key permissions for the access policy
    Name string
    SecretPermissions []string
    the secret permissions for the access policy
    certificatePermissions List<String>
    the certificate permissions for the access policy
    id String
    The provider-assigned unique ID for this managed resource.
    keyPermissions List<String>
    the key permissions for the access policy
    name String
    secretPermissions List<String>
    the secret permissions for the access policy
    certificatePermissions string[]
    the certificate permissions for the access policy
    id string
    The provider-assigned unique ID for this managed resource.
    keyPermissions string[]
    the key permissions for the access policy
    name string
    secretPermissions string[]
    the secret permissions for the access policy
    certificate_permissions Sequence[str]
    the certificate permissions for the access policy
    id str
    The provider-assigned unique ID for this managed resource.
    key_permissions Sequence[str]
    the key permissions for the access policy
    name str
    secret_permissions Sequence[str]
    the secret permissions for the access policy
    certificatePermissions List<String>
    the certificate permissions for the access policy
    id String
    The provider-assigned unique ID for this managed resource.
    keyPermissions List<String>
    the key permissions for the access policy
    name String
    secretPermissions List<String>
    the secret permissions for the access policy

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.80.0 published on Monday, Jun 10, 2024 by Pulumi