com.pulumi.azure.keyvault.ManagedHardwareSecurityModule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure Show documentation
Show all versions of azure Show documentation
A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.azure.keyvault;
import com.pulumi.azure.Utilities;
import com.pulumi.azure.keyvault.ManagedHardwareSecurityModuleArgs;
import com.pulumi.azure.keyvault.inputs.ManagedHardwareSecurityModuleState;
import com.pulumi.azure.keyvault.outputs.ManagedHardwareSecurityModuleNetworkAcls;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Manages a Key Vault Managed Hardware Security Module.
*
* > **Note:** The Azure Provider includes a Feature Toggle which will purge a Key Vault Managed Hardware Security Module resource on destroy, rather than the default soft-delete. See `purge_soft_deleted_hardware_security_modules_on_destroy` for more information.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.core.CoreFunctions;
* import com.pulumi.azure.core.ResourceGroup;
* import com.pulumi.azure.core.ResourceGroupArgs;
* import com.pulumi.azure.keyvault.ManagedHardwareSecurityModule;
* import com.pulumi.azure.keyvault.ManagedHardwareSecurityModuleArgs;
* 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 current = CoreFunctions.getClientConfig();
*
* var example = new ResourceGroup("example", ResourceGroupArgs.builder()
* .name("example-resources")
* .location("West Europe")
* .build());
*
* var exampleManagedHardwareSecurityModule = new ManagedHardwareSecurityModule("exampleManagedHardwareSecurityModule", ManagedHardwareSecurityModuleArgs.builder()
* .name("exampleKVHsm")
* .resourceGroupName(example.name())
* .location(example.location())
* .skuName("Standard_B1")
* .purgeProtectionEnabled(false)
* .softDeleteRetentionDays(90)
* .tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
* .adminObjectIds(current.applyValue(getClientConfigResult -> getClientConfigResult.objectId()))
* .tags(Map.of("Env", "Test"))
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Key Vault Managed Hardware Security Module can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:keyvault/managedHardwareSecurityModule:ManagedHardwareSecurityModule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.KeyVault/managedHSMs/hsm1
* ```
*
*/
@ResourceType(type="azure:keyvault/managedHardwareSecurityModule:ManagedHardwareSecurityModule")
public class ManagedHardwareSecurityModule extends com.pulumi.resources.CustomResource {
/**
* Specifies a list of administrators object IDs for the key vault Managed Hardware Security Module. Changing this forces a new resource to be created.
*
*/
@Export(name="adminObjectIds", refs={List.class,String.class}, tree="[0,1]")
private Output> adminObjectIds;
/**
* @return Specifies a list of administrators object IDs for the key vault Managed Hardware Security Module. Changing this forces a new resource to be created.
*
*/
public Output> adminObjectIds() {
return this.adminObjectIds;
}
/**
* The URI of the Key Vault Managed Hardware Security Module, used for performing operations on keys.
*
*/
@Export(name="hsmUri", refs={String.class}, tree="[0]")
private Output hsmUri;
/**
* @return The URI of the Key Vault Managed Hardware Security Module, used for performing operations on keys.
*
*/
public Output hsmUri() {
return this.hsmUri;
}
/**
* Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
*
*/
@Export(name="location", refs={String.class}, tree="[0]")
private Output location;
/**
* @return Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
*
*/
public Output location() {
return this.location;
}
/**
* Specifies the name of the Key Vault Managed Hardware Security Module. Changing this forces a new resource to be created.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return Specifies the name of the Key Vault Managed Hardware Security Module. Changing this forces a new resource to be created.
*
*/
public Output name() {
return this.name;
}
/**
* A `network_acls` block as defined below.
*
*/
@Export(name="networkAcls", refs={ManagedHardwareSecurityModuleNetworkAcls.class}, tree="[0]")
private Output networkAcls;
/**
* @return A `network_acls` block as defined below.
*
*/
public Output networkAcls() {
return this.networkAcls;
}
/**
* Whether traffic from public networks is permitted. Defaults to `true`. Changing this forces a new resource to be created.
*
*/
@Export(name="publicNetworkAccessEnabled", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> publicNetworkAccessEnabled;
/**
* @return Whether traffic from public networks is permitted. Defaults to `true`. Changing this forces a new resource to be created.
*
*/
public Output> publicNetworkAccessEnabled() {
return Codegen.optional(this.publicNetworkAccessEnabled);
}
/**
* Is Purge Protection enabled for this Key Vault Managed Hardware Security Module? Changing this forces a new resource to be created.
*
*/
@Export(name="purgeProtectionEnabled", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> purgeProtectionEnabled;
/**
* @return Is Purge Protection enabled for this Key Vault Managed Hardware Security Module? Changing this forces a new resource to be created.
*
*/
public Output> purgeProtectionEnabled() {
return Codegen.optional(this.purgeProtectionEnabled);
}
/**
* The name of the resource group in which to create the Key Vault Managed Hardware Security Module. Changing this forces a new resource to be created.
*
*/
@Export(name="resourceGroupName", refs={String.class}, tree="[0]")
private Output resourceGroupName;
/**
* @return The name of the resource group in which to create the Key Vault Managed Hardware Security Module. Changing this forces a new resource to be created.
*
*/
public Output resourceGroupName() {
return this.resourceGroupName;
}
/**
* This attribute can be used for disaster recovery or when creating another Managed HSM that shares the same security domain.
*
*/
@Export(name="securityDomainEncryptedData", refs={String.class}, tree="[0]")
private Output securityDomainEncryptedData;
/**
* @return This attribute can be used for disaster recovery or when creating another Managed HSM that shares the same security domain.
*
*/
public Output securityDomainEncryptedData() {
return this.securityDomainEncryptedData;
}
/**
* A list of KeyVault certificates resource IDs (minimum of three and up to a maximum of 10) to activate this Managed HSM. More information see [activate-your-managed-hsm](https://learn.microsoft.com/azure/key-vault/managed-hsm/quick-create-cli#activate-your-managed-hsm)
*
*/
@Export(name="securityDomainKeyVaultCertificateIds", refs={List.class,String.class}, tree="[0,1]")
private Output* @Nullable */ List> securityDomainKeyVaultCertificateIds;
/**
* @return A list of KeyVault certificates resource IDs (minimum of three and up to a maximum of 10) to activate this Managed HSM. More information see [activate-your-managed-hsm](https://learn.microsoft.com/azure/key-vault/managed-hsm/quick-create-cli#activate-your-managed-hsm)
*
*/
public Output>> securityDomainKeyVaultCertificateIds() {
return Codegen.optional(this.securityDomainKeyVaultCertificateIds);
}
/**
* Specifies the minimum number of shares required to decrypt the security domain for recovery. This is required when `security_domain_key_vault_certificate_ids` is specified. Valid values are between 2 and 10.
*
*/
@Export(name="securityDomainQuorum", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> securityDomainQuorum;
/**
* @return Specifies the minimum number of shares required to decrypt the security domain for recovery. This is required when `security_domain_key_vault_certificate_ids` is specified. Valid values are between 2 and 10.
*
*/
public Output> securityDomainQuorum() {
return Codegen.optional(this.securityDomainQuorum);
}
/**
* The Name of the SKU used for this Key Vault Managed Hardware Security Module. Possible value is `Standard_B1`. Changing this forces a new resource to be created.
*
*/
@Export(name="skuName", refs={String.class}, tree="[0]")
private Output skuName;
/**
* @return The Name of the SKU used for this Key Vault Managed Hardware Security Module. Possible value is `Standard_B1`. Changing this forces a new resource to be created.
*
*/
public Output skuName() {
return this.skuName;
}
/**
* The number of days that items should be retained for once soft-deleted. This value can be between `7` and `90` days. Defaults to `90`. Changing this forces a new resource to be created.
*
*/
@Export(name="softDeleteRetentionDays", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> softDeleteRetentionDays;
/**
* @return The number of days that items should be retained for once soft-deleted. This value can be between `7` and `90` days. Defaults to `90`. Changing this forces a new resource to be created.
*
*/
public Output> softDeleteRetentionDays() {
return Codegen.optional(this.softDeleteRetentionDays);
}
/**
* A mapping of tags to assign to the resource.
*
*/
@Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> tags;
/**
* @return A mapping of tags to assign to the resource.
*
*/
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
* The Azure Active Directory Tenant ID that should be used for authenticating requests to the key vault Managed Hardware Security Module. Changing this forces a new resource to be created.
*
*/
@Export(name="tenantId", refs={String.class}, tree="[0]")
private Output tenantId;
/**
* @return The Azure Active Directory Tenant ID that should be used for authenticating requests to the key vault Managed Hardware Security Module. Changing this forces a new resource to be created.
*
*/
public Output tenantId() {
return this.tenantId;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public ManagedHardwareSecurityModule(java.lang.String name) {
this(name, ManagedHardwareSecurityModuleArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public ManagedHardwareSecurityModule(java.lang.String name, ManagedHardwareSecurityModuleArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public ManagedHardwareSecurityModule(java.lang.String name, ManagedHardwareSecurityModuleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:keyvault/managedHardwareSecurityModule:ManagedHardwareSecurityModule", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private ManagedHardwareSecurityModule(java.lang.String name, Output id, @Nullable ManagedHardwareSecurityModuleState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:keyvault/managedHardwareSecurityModule:ManagedHardwareSecurityModule", name, state, makeResourceOptions(options, id), false);
}
private static ManagedHardwareSecurityModuleArgs makeArgs(ManagedHardwareSecurityModuleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? ManagedHardwareSecurityModuleArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.additionalSecretOutputs(List.of(
"securityDomainEncryptedData"
))
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static ManagedHardwareSecurityModule get(java.lang.String name, Output id, @Nullable ManagedHardwareSecurityModuleState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new ManagedHardwareSecurityModule(name, id, state, options);
}
}