azure-native.keyvault.getKey
Explore with Pulumi AI
Gets the current version of the specified key from the specified key vault.
Uses Azure REST API version 2024-11-01.
Other available API versions: 2023-02-01, 2023-07-01, 2024-04-01-preview, 2024-12-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native keyvault [ApiVersion]. See the version guide for details.
Using getKey
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 getKey(args: GetKeyArgs, opts?: InvokeOptions): Promise<GetKeyResult>
function getKeyOutput(args: GetKeyOutputArgs, opts?: InvokeOptions): Output<GetKeyResult>def get_key(key_name: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            vault_name: Optional[str] = None,
            opts: Optional[InvokeOptions] = None) -> GetKeyResult
def get_key_output(key_name: Optional[pulumi.Input[str]] = None,
            resource_group_name: Optional[pulumi.Input[str]] = None,
            vault_name: Optional[pulumi.Input[str]] = None,
            opts: Optional[InvokeOptions] = None) -> Output[GetKeyResult]func LookupKey(ctx *Context, args *LookupKeyArgs, opts ...InvokeOption) (*LookupKeyResult, error)
func LookupKeyOutput(ctx *Context, args *LookupKeyOutputArgs, opts ...InvokeOption) LookupKeyResultOutput> Note: This function is named LookupKey in the Go SDK.
public static class GetKey 
{
    public static Task<GetKeyResult> InvokeAsync(GetKeyArgs args, InvokeOptions? opts = null)
    public static Output<GetKeyResult> Invoke(GetKeyInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetKeyResult> getKey(GetKeyArgs args, InvokeOptions options)
public static Output<GetKeyResult> getKey(GetKeyArgs args, InvokeOptions options)
fn::invoke:
  function: azure-native:keyvault:getKey
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Key
Name string - The name of the key to be retrieved.
 - Resource
Group stringName  - The name of the resource group which contains the specified key vault.
 - Vault
Name string - The name of the vault which contains the key to be retrieved.
 
- Key
Name string - The name of the key to be retrieved.
 - Resource
Group stringName  - The name of the resource group which contains the specified key vault.
 - Vault
Name string - The name of the vault which contains the key to be retrieved.
 
- key
Name String - The name of the key to be retrieved.
 - resource
Group StringName  - The name of the resource group which contains the specified key vault.
 - vault
Name String - The name of the vault which contains the key to be retrieved.
 
- key
Name string - The name of the key to be retrieved.
 - resource
Group stringName  - The name of the resource group which contains the specified key vault.
 - vault
Name string - The name of the vault which contains the key to be retrieved.
 
- key_
name str - The name of the key to be retrieved.
 - resource_
group_ strname  - The name of the resource group which contains the specified key vault.
 - vault_
name str - The name of the vault which contains the key to be retrieved.
 
- key
Name String - The name of the key to be retrieved.
 - resource
Group StringName  - The name of the resource group which contains the specified key vault.
 - vault
Name String - The name of the vault which contains the key to be retrieved.
 
getKey Result
The following output properties are available:
- Azure
Api stringVersion  - The Azure API version of the resource.
 - Id string
 - Fully qualified identifier of the key vault resource.
 - Key
Uri string - The URI to retrieve the current version of the key.
 - Key
Uri stringWith Version  - The URI to retrieve the specific version of the key.
 - Location string
 - Azure location of the key vault resource.
 - Name string
 - Name of the key vault resource.
 - Dictionary<string, string>
 - Tags assigned to the key vault resource.
 - Type string
 - Resource type of the key vault resource.
 - Attributes
Pulumi.
Azure Native. Key Vault. Outputs. Key Attributes Response  - The attributes of the key.
 - Curve
Name string - The elliptic curve name. For valid values, see JsonWebKeyCurveName. Default for EC and EC-HSM keys is P-256
 - Key
Ops List<string> - Key
Size int - The key size in bits. For example: 2048, 3072, or 4096 for RSA. Default for RSA and RSA-HSM keys is 2048. Exception made for bring your own key (BYOK), key exchange keys default to 4096.
 - Kty string
 - The type of the key. For valid values, see JsonWebKeyType.
 - Release
Policy Pulumi.Azure Native. Key Vault. Outputs. Key Release Policy Response  - Key release policy in response. It will be used for both output and input. Omitted if empty
 - Rotation
Policy Pulumi.Azure Native. Key Vault. Outputs. Rotation Policy Response  - Key rotation policy in response. It will be used for both output and input. Omitted if empty
 
- Azure
Api stringVersion  - The Azure API version of the resource.
 - Id string
 - Fully qualified identifier of the key vault resource.
 - Key
Uri string - The URI to retrieve the current version of the key.
 - Key
Uri stringWith Version  - The URI to retrieve the specific version of the key.
 - Location string
 - Azure location of the key vault resource.
 - Name string
 - Name of the key vault resource.
 - map[string]string
 - Tags assigned to the key vault resource.
 - Type string
 - Resource type of the key vault resource.
 - Attributes
Key
Attributes Response  - The attributes of the key.
 - Curve
Name string - The elliptic curve name. For valid values, see JsonWebKeyCurveName. Default for EC and EC-HSM keys is P-256
 - Key
Ops []string - Key
Size int - The key size in bits. For example: 2048, 3072, or 4096 for RSA. Default for RSA and RSA-HSM keys is 2048. Exception made for bring your own key (BYOK), key exchange keys default to 4096.
 - Kty string
 - The type of the key. For valid values, see JsonWebKeyType.
 - Release
Policy KeyRelease Policy Response  - Key release policy in response. It will be used for both output and input. Omitted if empty
 - Rotation
Policy RotationPolicy Response  - Key rotation policy in response. It will be used for both output and input. Omitted if empty
 
- azure
Api StringVersion  - The Azure API version of the resource.
 - id String
 - Fully qualified identifier of the key vault resource.
 - key
Uri String - The URI to retrieve the current version of the key.
 - key
Uri StringWith Version  - The URI to retrieve the specific version of the key.
 - location String
 - Azure location of the key vault resource.
 - name String
 - Name of the key vault resource.
 - Map<String,String>
 - Tags assigned to the key vault resource.
 - type String
 - Resource type of the key vault resource.
 - attributes
Key
Attributes Response  - The attributes of the key.
 - curve
Name String - The elliptic curve name. For valid values, see JsonWebKeyCurveName. Default for EC and EC-HSM keys is P-256
 - key
Ops List<String> - key
Size Integer - The key size in bits. For example: 2048, 3072, or 4096 for RSA. Default for RSA and RSA-HSM keys is 2048. Exception made for bring your own key (BYOK), key exchange keys default to 4096.
 - kty String
 - The type of the key. For valid values, see JsonWebKeyType.
 - release
Policy KeyRelease Policy Response  - Key release policy in response. It will be used for both output and input. Omitted if empty
 - rotation
Policy RotationPolicy Response  - Key rotation policy in response. It will be used for both output and input. Omitted if empty
 
- azure
Api stringVersion  - The Azure API version of the resource.
 - id string
 - Fully qualified identifier of the key vault resource.
 - key
Uri string - The URI to retrieve the current version of the key.
 - key
Uri stringWith Version  - The URI to retrieve the specific version of the key.
 - location string
 - Azure location of the key vault resource.
 - name string
 - Name of the key vault resource.
 - {[key: string]: string}
 - Tags assigned to the key vault resource.
 - type string
 - Resource type of the key vault resource.
 - attributes
Key
Attributes Response  - The attributes of the key.
 - curve
Name string - The elliptic curve name. For valid values, see JsonWebKeyCurveName. Default for EC and EC-HSM keys is P-256
 - key
Ops string[] - key
Size number - The key size in bits. For example: 2048, 3072, or 4096 for RSA. Default for RSA and RSA-HSM keys is 2048. Exception made for bring your own key (BYOK), key exchange keys default to 4096.
 - kty string
 - The type of the key. For valid values, see JsonWebKeyType.
 - release
Policy KeyRelease Policy Response  - Key release policy in response. It will be used for both output and input. Omitted if empty
 - rotation
Policy RotationPolicy Response  - Key rotation policy in response. It will be used for both output and input. Omitted if empty
 
- azure_
api_ strversion  - The Azure API version of the resource.
 - id str
 - Fully qualified identifier of the key vault resource.
 - key_
uri str - The URI to retrieve the current version of the key.
 - key_
uri_ strwith_ version  - The URI to retrieve the specific version of the key.
 - location str
 - Azure location of the key vault resource.
 - name str
 - Name of the key vault resource.
 - Mapping[str, str]
 - Tags assigned to the key vault resource.
 - type str
 - Resource type of the key vault resource.
 - attributes
Key
Attributes Response  - The attributes of the key.
 - curve_
name str - The elliptic curve name. For valid values, see JsonWebKeyCurveName. Default for EC and EC-HSM keys is P-256
 - key_
ops Sequence[str] - key_
size int - The key size in bits. For example: 2048, 3072, or 4096 for RSA. Default for RSA and RSA-HSM keys is 2048. Exception made for bring your own key (BYOK), key exchange keys default to 4096.
 - kty str
 - The type of the key. For valid values, see JsonWebKeyType.
 - release_
policy KeyRelease Policy Response  - Key release policy in response. It will be used for both output and input. Omitted if empty
 - rotation_
policy RotationPolicy Response  - Key rotation policy in response. It will be used for both output and input. Omitted if empty
 
- azure
Api StringVersion  - The Azure API version of the resource.
 - id String
 - Fully qualified identifier of the key vault resource.
 - key
Uri String - The URI to retrieve the current version of the key.
 - key
Uri StringWith Version  - The URI to retrieve the specific version of the key.
 - location String
 - Azure location of the key vault resource.
 - name String
 - Name of the key vault resource.
 - Map<String>
 - Tags assigned to the key vault resource.
 - type String
 - Resource type of the key vault resource.
 - attributes Property Map
 - The attributes of the key.
 - curve
Name String - The elliptic curve name. For valid values, see JsonWebKeyCurveName. Default for EC and EC-HSM keys is P-256
 - key
Ops List<String> - key
Size Number - The key size in bits. For example: 2048, 3072, or 4096 for RSA. Default for RSA and RSA-HSM keys is 2048. Exception made for bring your own key (BYOK), key exchange keys default to 4096.
 - kty String
 - The type of the key. For valid values, see JsonWebKeyType.
 - release
Policy Property Map - Key release policy in response. It will be used for both output and input. Omitted if empty
 - rotation
Policy Property Map - Key rotation policy in response. It will be used for both output and input. Omitted if empty
 
Supporting Types
ActionResponse 
- Type string
 - The type of action.
 
- Type string
 - The type of action.
 
- type String
 - The type of action.
 
- type string
 - The type of action.
 
- type str
 - The type of action.
 
- type String
 - The type of action.
 
KeyAttributesResponse  
- Created double
 - Creation time in seconds since 1970-01-01T00:00:00Z.
 - Recovery
Level string - The deletion recovery level currently in effect for the object. If it contains 'Purgeable', then the object can be permanently deleted by a privileged user; otherwise, only the system can purge the object at the end of the retention interval.
 - Updated double
 - Last updated time in seconds since 1970-01-01T00:00:00Z.
 - Enabled bool
 - Determines whether or not the object is enabled.
 - Expires double
 - Expiry date in seconds since 1970-01-01T00:00:00Z.
 - Exportable bool
 - Indicates if the private key can be exported.
 - Not
Before double - Not before date in seconds since 1970-01-01T00:00:00Z.
 
- Created float64
 - Creation time in seconds since 1970-01-01T00:00:00Z.
 - Recovery
Level string - The deletion recovery level currently in effect for the object. If it contains 'Purgeable', then the object can be permanently deleted by a privileged user; otherwise, only the system can purge the object at the end of the retention interval.
 - Updated float64
 - Last updated time in seconds since 1970-01-01T00:00:00Z.
 - Enabled bool
 - Determines whether or not the object is enabled.
 - Expires float64
 - Expiry date in seconds since 1970-01-01T00:00:00Z.
 - Exportable bool
 - Indicates if the private key can be exported.
 - Not
Before float64 - Not before date in seconds since 1970-01-01T00:00:00Z.
 
- created Double
 - Creation time in seconds since 1970-01-01T00:00:00Z.
 - recovery
Level String - The deletion recovery level currently in effect for the object. If it contains 'Purgeable', then the object can be permanently deleted by a privileged user; otherwise, only the system can purge the object at the end of the retention interval.
 - updated Double
 - Last updated time in seconds since 1970-01-01T00:00:00Z.
 - enabled Boolean
 - Determines whether or not the object is enabled.
 - expires Double
 - Expiry date in seconds since 1970-01-01T00:00:00Z.
 - exportable Boolean
 - Indicates if the private key can be exported.
 - not
Before Double - Not before date in seconds since 1970-01-01T00:00:00Z.
 
- created number
 - Creation time in seconds since 1970-01-01T00:00:00Z.
 - recovery
Level string - The deletion recovery level currently in effect for the object. If it contains 'Purgeable', then the object can be permanently deleted by a privileged user; otherwise, only the system can purge the object at the end of the retention interval.
 - updated number
 - Last updated time in seconds since 1970-01-01T00:00:00Z.
 - enabled boolean
 - Determines whether or not the object is enabled.
 - expires number
 - Expiry date in seconds since 1970-01-01T00:00:00Z.
 - exportable boolean
 - Indicates if the private key can be exported.
 - not
Before number - Not before date in seconds since 1970-01-01T00:00:00Z.
 
- created float
 - Creation time in seconds since 1970-01-01T00:00:00Z.
 - recovery_
level str - The deletion recovery level currently in effect for the object. If it contains 'Purgeable', then the object can be permanently deleted by a privileged user; otherwise, only the system can purge the object at the end of the retention interval.
 - updated float
 - Last updated time in seconds since 1970-01-01T00:00:00Z.
 - enabled bool
 - Determines whether or not the object is enabled.
 - expires float
 - Expiry date in seconds since 1970-01-01T00:00:00Z.
 - exportable bool
 - Indicates if the private key can be exported.
 - not_
before float - Not before date in seconds since 1970-01-01T00:00:00Z.
 
- created Number
 - Creation time in seconds since 1970-01-01T00:00:00Z.
 - recovery
Level String - The deletion recovery level currently in effect for the object. If it contains 'Purgeable', then the object can be permanently deleted by a privileged user; otherwise, only the system can purge the object at the end of the retention interval.
 - updated Number
 - Last updated time in seconds since 1970-01-01T00:00:00Z.
 - enabled Boolean
 - Determines whether or not the object is enabled.
 - expires Number
 - Expiry date in seconds since 1970-01-01T00:00:00Z.
 - exportable Boolean
 - Indicates if the private key can be exported.
 - not
Before Number - Not before date in seconds since 1970-01-01T00:00:00Z.
 
KeyReleasePolicyResponse   
- Content
Type string - Content type and version of key release policy
 - Data string
 - Blob encoding the policy rules under which the key can be released.
 
- Content
Type string - Content type and version of key release policy
 - Data string
 - Blob encoding the policy rules under which the key can be released.
 
- content
Type String - Content type and version of key release policy
 - data String
 - Blob encoding the policy rules under which the key can be released.
 
- content
Type string - Content type and version of key release policy
 - data string
 - Blob encoding the policy rules under which the key can be released.
 
- content_
type str - Content type and version of key release policy
 - data str
 - Blob encoding the policy rules under which the key can be released.
 
- content
Type String - Content type and version of key release policy
 - data String
 - Blob encoding the policy rules under which the key can be released.
 
KeyRotationPolicyAttributesResponse    
- Created double
 - Creation time in seconds since 1970-01-01T00:00:00Z.
 - Updated double
 - Last updated time in seconds since 1970-01-01T00:00:00Z.
 - Expiry
Time string - The expiration time for the new key version. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'.
 
- Created float64
 - Creation time in seconds since 1970-01-01T00:00:00Z.
 - Updated float64
 - Last updated time in seconds since 1970-01-01T00:00:00Z.
 - Expiry
Time string - The expiration time for the new key version. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'.
 
- created Double
 - Creation time in seconds since 1970-01-01T00:00:00Z.
 - updated Double
 - Last updated time in seconds since 1970-01-01T00:00:00Z.
 - expiry
Time String - The expiration time for the new key version. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'.
 
- created number
 - Creation time in seconds since 1970-01-01T00:00:00Z.
 - updated number
 - Last updated time in seconds since 1970-01-01T00:00:00Z.
 - expiry
Time string - The expiration time for the new key version. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'.
 
- created float
 - Creation time in seconds since 1970-01-01T00:00:00Z.
 - updated float
 - Last updated time in seconds since 1970-01-01T00:00:00Z.
 - expiry_
time str - The expiration time for the new key version. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'.
 
- created Number
 - Creation time in seconds since 1970-01-01T00:00:00Z.
 - updated Number
 - Last updated time in seconds since 1970-01-01T00:00:00Z.
 - expiry
Time String - The expiration time for the new key version. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'.
 
LifetimeActionResponse  
- Action
Pulumi.
Azure Native. Key Vault. Inputs. Action Response  - The action of key rotation policy lifetimeAction.
 - Trigger
Pulumi.
Azure Native. Key Vault. Inputs. Trigger Response  - The trigger of key rotation policy lifetimeAction.
 
- Action
Action
Response  - The action of key rotation policy lifetimeAction.
 - Trigger
Trigger
Response  - The trigger of key rotation policy lifetimeAction.
 
- action
Action
Response  - The action of key rotation policy lifetimeAction.
 - trigger
Trigger
Response  - The trigger of key rotation policy lifetimeAction.
 
- action
Action
Response  - The action of key rotation policy lifetimeAction.
 - trigger
Trigger
Response  - The trigger of key rotation policy lifetimeAction.
 
- action
Action
Response  - The action of key rotation policy lifetimeAction.
 - trigger
Trigger
Response  - The trigger of key rotation policy lifetimeAction.
 
- action Property Map
 - The action of key rotation policy lifetimeAction.
 - trigger Property Map
 - The trigger of key rotation policy lifetimeAction.
 
RotationPolicyResponse  
- Attributes
Pulumi.
Azure Native. Key Vault. Inputs. Key Rotation Policy Attributes Response  - The attributes of key rotation policy.
 - Lifetime
Actions List<Pulumi.Azure Native. Key Vault. Inputs. Lifetime Action Response>  - The lifetimeActions for key rotation action.
 
- Attributes
Key
Rotation Policy Attributes Response  - The attributes of key rotation policy.
 - Lifetime
Actions []LifetimeAction Response  - The lifetimeActions for key rotation action.
 
- attributes
Key
Rotation Policy Attributes Response  - The attributes of key rotation policy.
 - lifetime
Actions List<LifetimeAction Response>  - The lifetimeActions for key rotation action.
 
- attributes
Key
Rotation Policy Attributes Response  - The attributes of key rotation policy.
 - lifetime
Actions LifetimeAction Response[]  - The lifetimeActions for key rotation action.
 
- attributes
Key
Rotation Policy Attributes Response  - The attributes of key rotation policy.
 - lifetime_
actions Sequence[LifetimeAction Response]  - The lifetimeActions for key rotation action.
 
- attributes Property Map
 - The attributes of key rotation policy.
 - lifetime
Actions List<Property Map> - The lifetimeActions for key rotation action.
 
TriggerResponse 
- Time
After stringCreate  - The time duration after key creation to rotate the key. It only applies to rotate. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'.
 - Time
Before stringExpiry  - The time duration before key expiring to rotate or notify. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'.
 
- Time
After stringCreate  - The time duration after key creation to rotate the key. It only applies to rotate. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'.
 - Time
Before stringExpiry  - The time duration before key expiring to rotate or notify. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'.
 
- time
After StringCreate  - The time duration after key creation to rotate the key. It only applies to rotate. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'.
 - time
Before StringExpiry  - The time duration before key expiring to rotate or notify. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'.
 
- time
After stringCreate  - The time duration after key creation to rotate the key. It only applies to rotate. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'.
 - time
Before stringExpiry  - The time duration before key expiring to rotate or notify. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'.
 
- time_
after_ strcreate  - The time duration after key creation to rotate the key. It only applies to rotate. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'.
 - time_
before_ strexpiry  - The time duration before key expiring to rotate or notify. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'.
 
- time
After StringCreate  - The time duration after key creation to rotate the key. It only applies to rotate. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'.
 - time
Before StringExpiry  - The time duration before key expiring to rotate or notify. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'.
 
Package Details
- Repository
 - Azure Native pulumi/pulumi-azure-native
 - License
 - Apache-2.0