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
LookupKeyin the Go SDK.
public static class GetKey {
public static Task<GetKeyResult> InvokeAsync(GetKeyArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Key
Vault stringId Specifies the ID of the Key Vault instance where the Secret resides, available on the
azure.keyvault.KeyVaultData Source / Resource.- Name string
Specifies the name of the Key Vault Key.
- Key
Vault stringId Specifies the ID of the Key Vault instance where the Secret resides, available on the
azure.keyvault.KeyVaultData Source / Resource.- Name string
Specifies the name of the Key Vault Key.
- key
Vault stringId Specifies the ID of the Key Vault instance where the Secret resides, available on the
azure.keyvault.KeyVaultData Source / Resource.- name string
Specifies the name of the Key Vault Key.
- key_
vault_ strid Specifies the ID of the Key Vault instance where the Secret resides, available on the
azure.keyvault.KeyVaultData 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.
- Key
Opts List<string> A list of JSON web key operations assigned to this Key Vault Key
- Key
Size int Specifies the Size of this Key Vault Key.
- Key
Type string Specifies the Key Type of this Key Vault Key
- Key
Vault stringId - N string
The RSA modulus of this Key Vault Key.
- Name string
- 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.
- Key
Opts []string A list of JSON web key operations assigned to this Key Vault Key
- Key
Size int Specifies the Size of this Key Vault Key.
- Key
Type string Specifies the Key Type of this Key Vault Key
- Key
Vault stringId - N string
The RSA modulus of this Key Vault Key.
- Name string
- 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.
- key
Opts string[] A list of JSON web key operations assigned to this Key Vault Key
- key
Size number Specifies the Size of this Key Vault Key.
- key
Type string Specifies the Key Type of this Key Vault Key
- key
Vault stringId - n string
The RSA modulus of this Key Vault Key.
- name string
- {[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_ strid - n str
The RSA modulus of this Key Vault Key.
- name str
- 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
azurermTerraform Provider.