We recommend using Azure Native.
Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi
azure.keyvault.getAccessPolicy
Explore with Pulumi AI
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/v6/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:
- Certificate
Permissions List<string> - the certificate permissions for the access policy
- Id string
- The provider-assigned unique ID for this managed resource.
- Key
Permissions List<string> - the key permissions for the access policy
- Name string
- Secret
Permissions List<string> - the secret permissions for the access policy
- Certificate
Permissions []string - the certificate permissions for the access policy
- Id string
- The provider-assigned unique ID for this managed resource.
- Key
Permissions []string - the key permissions for the access policy
- Name string
- Secret
Permissions []string - the secret permissions for the access policy
- certificate
Permissions List<String> - the certificate permissions for the access policy
- id String
- The provider-assigned unique ID for this managed resource.
- key
Permissions List<String> - the key permissions for the access policy
- name String
- secret
Permissions List<String> - the secret permissions for the access policy
- certificate
Permissions string[] - the certificate permissions for the access policy
- id string
- The provider-assigned unique ID for this managed resource.
- key
Permissions string[] - the key permissions for the access policy
- name string
- secret
Permissions 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
- certificate
Permissions List<String> - the certificate permissions for the access policy
- id String
- The provider-assigned unique ID for this managed resource.
- key
Permissions List<String> - the key permissions for the access policy
- name String
- secret
Permissions 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.