GetKey

Use this data source to access information about an existing Key Vault Key.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Azure.KeyVault.GetKey.InvokeAsync(new Azure.KeyVault.GetKeyArgs
        {
            Name = "secret-sauce",
            KeyVaultId = data.Azurerm_key_vault.Existing.Id,
        }));
        this.KeyType = example.Apply(example => example.KeyType);
    }

    [Output("keyType")]
    public Output<string> KeyType { get; set; }
}
package main

import (
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/keyvault"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        example, err := keyvault.LookupKey(ctx, &keyvault.LookupKeyArgs{
            Name:       "secret-sauce",
            KeyVaultId: data.Azurerm_key_vault.Existing.Id,
        }, nil)
        if err != nil {
            return err
        }
        ctx.Export("keyType", example.KeyType)
        return nil
    })
}
import pulumi
import pulumi_azure as azure

example = azure.keyvault.get_key(name="secret-sauce",
    key_vault_id=data["azurerm_key_vault"]["existing"]["id"])
pulumi.export("keyType", example.key_type)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.keyvault.getKey({
    name: "secret-sauce",
    keyVaultId: data.azurerm_key_vault.existing.id,
});
export const keyType = example.then(example => example.keyType);

Using GetKey

function getKey(args: GetKeyArgs, opts?: InvokeOptions): Promise<GetKeyResult>
function  get_key(key_vault_id=None, name=None, opts=None)
func LookupKey(ctx *Context, args *LookupKeyArgs, opts ...InvokeOption) (*LookupKeyResult, error)

Note: This function is named LookupKey in the Go SDK.

public static class GetKey {
    public static Task<GetKeyResult> InvokeAsync(GetKeyArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

KeyVaultId string

Specifies the ID of the Key Vault instance where the Secret resides, available on the azure.keyvault.KeyVault Data Source / Resource.

Name string

Specifies the name of the Key Vault Key.

KeyVaultId string

Specifies the ID of the Key Vault instance where the Secret resides, available on the azure.keyvault.KeyVault Data Source / Resource.

Name string

Specifies the name of the Key Vault Key.

keyVaultId string

Specifies the ID of the Key Vault instance where the Secret resides, available on the azure.keyvault.KeyVault Data Source / Resource.

name string

Specifies the name of the Key Vault Key.

key_vault_id str

Specifies the ID of the Key Vault instance where the Secret resides, available on the azure.keyvault.KeyVault Data Source / Resource.

name str

Specifies the name of the Key Vault Key.

GetKey Result

The following output properties are available:

E string

The RSA public exponent of this Key Vault Key.

Id string

The provider-assigned unique ID for this managed resource.

KeyOpts List<string>

A list of JSON web key operations assigned to this Key Vault Key

KeySize int

Specifies the Size of this Key Vault Key.

KeyType string

Specifies the Key Type of this Key Vault Key

KeyVaultId string
N string

The RSA modulus of this Key Vault Key.

Name string
Tags Dictionary<string, string>

A mapping of tags assigned to this Key Vault Key.

Version string

The current version of the Key Vault Key.

E string

The RSA public exponent of this Key Vault Key.

Id string

The provider-assigned unique ID for this managed resource.

KeyOpts []string

A list of JSON web key operations assigned to this Key Vault Key

KeySize int

Specifies the Size of this Key Vault Key.

KeyType string

Specifies the Key Type of this Key Vault Key

KeyVaultId string
N string

The RSA modulus of this Key Vault Key.

Name string
Tags map[string]string

A mapping of tags assigned to this Key Vault Key.

Version string

The current version of the Key Vault Key.

e string

The RSA public exponent of this Key Vault Key.

id string

The provider-assigned unique ID for this managed resource.

keyOpts string[]

A list of JSON web key operations assigned to this Key Vault Key

keySize number

Specifies the Size of this Key Vault Key.

keyType string

Specifies the Key Type of this Key Vault Key

keyVaultId string
n string

The RSA modulus of this Key Vault Key.

name string
tags {[key: string]: string}

A mapping of tags assigned to this Key Vault Key.

version string

The current version of the Key Vault Key.

e str

The RSA public exponent of this Key Vault Key.

id str

The provider-assigned unique ID for this managed resource.

key_opts List[str]

A list of JSON web key operations assigned to this Key Vault Key

key_size float

Specifies the Size of this Key Vault Key.

key_type str

Specifies the Key Type of this Key Vault Key

key_vault_id str
n str

The RSA modulus of this Key Vault Key.

name str
tags Dict[str, str]

A mapping of tags assigned to this Key Vault Key.

version str

The current version of the Key Vault Key.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.