Skip to main content

managed_hsm_keys

Creates, updates, deletes, gets or lists a managed_hsm_keys resource.

Overview

Namemanaged_hsm_keys
TypeResource
Idazure.key_vault.managed_hsm_keys

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
attributesobjectThe attributes of the key.
curveNamestringThe elliptic curve name. For valid values, see JsonWebKeyCurveName. Default for EC and EC-HSM keys is P-256. Known values are: "P-256", "P-384", "P-521", and "P-256K". (P-256, P-384, P-521, P-256K)
keyOpsarray:vartype key_ops: list[str or ~azure.mgmt.keyvault.models.JsonWebKeyOperation]
keySizeintegerThe 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.
keyUristringThe URI to retrieve the current version of the key.
keyUriWithVersionstringThe URI to retrieve the specific version of the key.
ktystringThe type of the key. For valid values, see JsonWebKeyType. Known values are: "EC", "EC-HSM", "RSA", and "RSA-HSM". (EC, EC-HSM, RSA, RSA-HSM)
release_policyobjectKey release policy in response. It will be used for both output and input. Omitted if empty.
rotationPolicyobjectKey rotation policy in response. It will be used for both output and input. Omitted if empty.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectResource tags.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_versionselectresource_group_name, name, key_name, key_version, subscription_idGets the specified version of the specified key in the specified managed HSM.
getselectresource_group_name, name, key_name, subscription_idGets the current version of the specified key from the specified managed HSM.
listselectresource_group_name, name, subscription_idLists the keys in the specified managed HSM.
create_if_not_existexecresource_group_name, name, key_name, subscription_id, propertiesCreates the first version of a new key if it does not exist. If it already exists, then the existing key is returned without any write operations being performed. This API does not create subsequent versions, and does not update existing keys.
list_versionsexecresource_group_name, name, key_name, subscription_idLists the keys in the specified managed HSM.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
key_namestringThe name of the key to be created. The value you provide may be copied globally for the purpose of running the service. The value provided should not include personally identifiable or sensitive information. Required.
key_versionstringThe version of the key to be retrieved. Required.
namestringThe name of the Managed HSM Pool within the specified resource group. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring

SELECT examples

Gets the specified version of the specified key in the specified managed HSM.

SELECT
id,
name,
attributes,
curveName,
keyOps,
keySize,
keyUri,
keyUriWithVersion,
kty,
release_policy,
rotationPolicy,
systemData,
tags,
type
FROM azure.key_vault.managed_hsm_keys
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND name = '{{ name }}' -- required
AND key_name = '{{ key_name }}' -- required
AND key_version = '{{ key_version }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

Lifecycle Methods

Creates the first version of a new key if it does not exist. If it already exists, then the existing key is returned without any write operations being performed. This API does not create subsequent versions, and does not update existing keys.

EXEC azure.key_vault.managed_hsm_keys.create_if_not_exist 
@resource_group_name='{{ resource_group_name }}' --required,
@name='{{ name }}' --required,
@key_name='{{ key_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"tags": "{{ tags }}",
"properties": "{{ properties }}"
}'
;