We recommend using Azure Native.
azure.keyvault.getManagedHardwareSecurityModuleKey
Explore with Pulumi AI
Use this data source to access information about an existing Managed Hardware Security Module Key.
Note: All arguments including the secret value will be stored in the raw state as plain-text. Read more about sensitive data in state.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
export = async () => {
const example = await azure.keyvault.getManagedHardwareSecurityModuleKey({
managedHsmId: exampleAzurermKeyVaultManagedHardwareSecurityModule.id,
name: exampleAzurermKeyVaultManagedHardwareSecurityModuleKey.name,
});
return {
"hsm-key-vesrion": example.version,
};
}
import pulumi
import pulumi_azure as azure
example = azure.keyvault.get_managed_hardware_security_module_key(managed_hsm_id=example_azurerm_key_vault_managed_hardware_security_module["id"],
name=example_azurerm_key_vault_managed_hardware_security_module_key["name"])
pulumi.export("hsm-key-vesrion", example.version)
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 {
example, err := keyvault.LookupManagedHardwareSecurityModuleKey(ctx, &keyvault.LookupManagedHardwareSecurityModuleKeyArgs{
ManagedHsmId: exampleAzurermKeyVaultManagedHardwareSecurityModule.Id,
Name: exampleAzurermKeyVaultManagedHardwareSecurityModuleKey.Name,
}, nil)
if err != nil {
return err
}
ctx.Export("hsm-key-vesrion", example.Version)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.KeyVault.GetManagedHardwareSecurityModuleKey.Invoke(new()
{
ManagedHsmId = exampleAzurermKeyVaultManagedHardwareSecurityModule.Id,
Name = exampleAzurermKeyVaultManagedHardwareSecurityModuleKey.Name,
});
return new Dictionary<string, object?>
{
["hsm-key-vesrion"] = example.Apply(getManagedHardwareSecurityModuleKeyResult => getManagedHardwareSecurityModuleKeyResult.Version),
};
});
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.GetManagedHardwareSecurityModuleKeyArgs;
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 example = KeyvaultFunctions.getManagedHardwareSecurityModuleKey(GetManagedHardwareSecurityModuleKeyArgs.builder()
.managedHsmId(exampleAzurermKeyVaultManagedHardwareSecurityModule.id())
.name(exampleAzurermKeyVaultManagedHardwareSecurityModuleKey.name())
.build());
ctx.export("hsm-key-vesrion", example.applyValue(getManagedHardwareSecurityModuleKeyResult -> getManagedHardwareSecurityModuleKeyResult.version()));
}
}
variables:
example:
fn::invoke:
Function: azure:keyvault:getManagedHardwareSecurityModuleKey
Arguments:
managedHsmId: ${exampleAzurermKeyVaultManagedHardwareSecurityModule.id}
name: ${exampleAzurermKeyVaultManagedHardwareSecurityModuleKey.name}
outputs:
hsm-key-vesrion: ${example.version}
Using getManagedHardwareSecurityModuleKey
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 getManagedHardwareSecurityModuleKey(args: GetManagedHardwareSecurityModuleKeyArgs, opts?: InvokeOptions): Promise<GetManagedHardwareSecurityModuleKeyResult>
function getManagedHardwareSecurityModuleKeyOutput(args: GetManagedHardwareSecurityModuleKeyOutputArgs, opts?: InvokeOptions): Output<GetManagedHardwareSecurityModuleKeyResult>
def get_managed_hardware_security_module_key(managed_hsm_id: Optional[str] = None,
name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetManagedHardwareSecurityModuleKeyResult
def get_managed_hardware_security_module_key_output(managed_hsm_id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetManagedHardwareSecurityModuleKeyResult]
func LookupManagedHardwareSecurityModuleKey(ctx *Context, args *LookupManagedHardwareSecurityModuleKeyArgs, opts ...InvokeOption) (*LookupManagedHardwareSecurityModuleKeyResult, error)
func LookupManagedHardwareSecurityModuleKeyOutput(ctx *Context, args *LookupManagedHardwareSecurityModuleKeyOutputArgs, opts ...InvokeOption) LookupManagedHardwareSecurityModuleKeyResultOutput
> Note: This function is named LookupManagedHardwareSecurityModuleKey
in the Go SDK.
public static class GetManagedHardwareSecurityModuleKey
{
public static Task<GetManagedHardwareSecurityModuleKeyResult> InvokeAsync(GetManagedHardwareSecurityModuleKeyArgs args, InvokeOptions? opts = null)
public static Output<GetManagedHardwareSecurityModuleKeyResult> Invoke(GetManagedHardwareSecurityModuleKeyInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetManagedHardwareSecurityModuleKeyResult> getManagedHardwareSecurityModuleKey(GetManagedHardwareSecurityModuleKeyArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: azure:keyvault/getManagedHardwareSecurityModuleKey:getManagedHardwareSecurityModuleKey
arguments:
# arguments dictionary
The following arguments are supported:
- Managed
Hsm stringId Specifies the ID of the Managed Hardware Security Module instance where the Secret resides, available on the
azure.keyvault.ManagedHardwareSecurityModuleKey
Data Source / Resource.NOTE: The Managed Hardware Security Module must be in the same subscription as the provider. If the Managed Hardware Security Module is in another subscription, you must create an aliased provider for that subscription.
- Name string
- Specifies the name of the Managed Hardware Security Module Key.
- Managed
Hsm stringId Specifies the ID of the Managed Hardware Security Module instance where the Secret resides, available on the
azure.keyvault.ManagedHardwareSecurityModuleKey
Data Source / Resource.NOTE: The Managed Hardware Security Module must be in the same subscription as the provider. If the Managed Hardware Security Module is in another subscription, you must create an aliased provider for that subscription.
- Name string
- Specifies the name of the Managed Hardware Security Module Key.
- managed
Hsm StringId Specifies the ID of the Managed Hardware Security Module instance where the Secret resides, available on the
azure.keyvault.ManagedHardwareSecurityModuleKey
Data Source / Resource.NOTE: The Managed Hardware Security Module must be in the same subscription as the provider. If the Managed Hardware Security Module is in another subscription, you must create an aliased provider for that subscription.
- name String
- Specifies the name of the Managed Hardware Security Module Key.
- managed
Hsm stringId Specifies the ID of the Managed Hardware Security Module instance where the Secret resides, available on the
azure.keyvault.ManagedHardwareSecurityModuleKey
Data Source / Resource.NOTE: The Managed Hardware Security Module must be in the same subscription as the provider. If the Managed Hardware Security Module is in another subscription, you must create an aliased provider for that subscription.
- name string
- Specifies the name of the Managed Hardware Security Module Key.
- managed_
hsm_ strid Specifies the ID of the Managed Hardware Security Module instance where the Secret resides, available on the
azure.keyvault.ManagedHardwareSecurityModuleKey
Data Source / Resource.NOTE: The Managed Hardware Security Module must be in the same subscription as the provider. If the Managed Hardware Security Module is in another subscription, you must create an aliased provider for that subscription.
- name str
- Specifies the name of the Managed Hardware Security Module Key.
- managed
Hsm StringId Specifies the ID of the Managed Hardware Security Module instance where the Secret resides, available on the
azure.keyvault.ManagedHardwareSecurityModuleKey
Data Source / Resource.NOTE: The Managed Hardware Security Module must be in the same subscription as the provider. If the Managed Hardware Security Module is in another subscription, you must create an aliased provider for that subscription.
- name String
- Specifies the name of the Managed Hardware Security Module Key.
getManagedHardwareSecurityModuleKey Result
The following output properties are available:
- Curve string
- The EC Curve name of this Managed Hardware Security Module Key.
- Expiration
Date string - 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 Managed Hardware Security Module Key
- Key
Size int - Specifies the Size of this Managed Hardware Security Module Key.
- Key
Type string - Specifies the Key Type of this Managed Hardware Security Module Key
- Managed
Hsm stringId - Name string
- Not
Before stringDate - Dictionary<string, string>
- A mapping of tags assigned to this Managed Hardware Security Module Key.
- Version string
- The current version of the Managed Hardware Security Module Key.
- Versioned
Id string - The versioned ID of the Managed Hardware Security Module Key.
- Curve string
- The EC Curve name of this Managed Hardware Security Module Key.
- Expiration
Date string - Id string
- The provider-assigned unique ID for this managed resource.
- Key
Opts []string - A list of JSON web key operations assigned to this Managed Hardware Security Module Key
- Key
Size int - Specifies the Size of this Managed Hardware Security Module Key.
- Key
Type string - Specifies the Key Type of this Managed Hardware Security Module Key
- Managed
Hsm stringId - Name string
- Not
Before stringDate - map[string]string
- A mapping of tags assigned to this Managed Hardware Security Module Key.
- Version string
- The current version of the Managed Hardware Security Module Key.
- Versioned
Id string - The versioned ID of the Managed Hardware Security Module Key.
- curve String
- The EC Curve name of this Managed Hardware Security Module Key.
- expiration
Date String - 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 Managed Hardware Security Module Key
- key
Size Integer - Specifies the Size of this Managed Hardware Security Module Key.
- key
Type String - Specifies the Key Type of this Managed Hardware Security Module Key
- managed
Hsm StringId - name String
- not
Before StringDate - Map<String,String>
- A mapping of tags assigned to this Managed Hardware Security Module Key.
- version String
- The current version of the Managed Hardware Security Module Key.
- versioned
Id String - The versioned ID of the Managed Hardware Security Module Key.
- curve string
- The EC Curve name of this Managed Hardware Security Module Key.
- expiration
Date string - id string
- The provider-assigned unique ID for this managed resource.
- key
Opts string[] - A list of JSON web key operations assigned to this Managed Hardware Security Module Key
- key
Size number - Specifies the Size of this Managed Hardware Security Module Key.
- key
Type string - Specifies the Key Type of this Managed Hardware Security Module Key
- managed
Hsm stringId - name string
- not
Before stringDate - {[key: string]: string}
- A mapping of tags assigned to this Managed Hardware Security Module Key.
- version string
- The current version of the Managed Hardware Security Module Key.
- versioned
Id string - The versioned ID of the Managed Hardware Security Module Key.
- curve str
- The EC Curve name of this Managed Hardware Security Module Key.
- expiration_
date str - id str
- The provider-assigned unique ID for this managed resource.
- key_
opts Sequence[str] - A list of JSON web key operations assigned to this Managed Hardware Security Module Key
- key_
size int - Specifies the Size of this Managed Hardware Security Module Key.
- key_
type str - Specifies the Key Type of this Managed Hardware Security Module Key
- managed_
hsm_ strid - name str
- not_
before_ strdate - Mapping[str, str]
- A mapping of tags assigned to this Managed Hardware Security Module Key.
- version str
- The current version of the Managed Hardware Security Module Key.
- versioned_
id str - The versioned ID of the Managed Hardware Security Module Key.
- curve String
- The EC Curve name of this Managed Hardware Security Module Key.
- expiration
Date String - 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 Managed Hardware Security Module Key
- key
Size Number - Specifies the Size of this Managed Hardware Security Module Key.
- key
Type String - Specifies the Key Type of this Managed Hardware Security Module Key
- managed
Hsm StringId - name String
- not
Before StringDate - Map<String>
- A mapping of tags assigned to this Managed Hardware Security Module Key.
- version String
- The current version of the Managed Hardware Security Module Key.
- versioned
Id String - The versioned ID of the Managed Hardware Security Module Key.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.