Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// *** 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.eventhub;
import com.pulumi.azure.Utilities;
import com.pulumi.azure.eventhub.NamespaceCustomerManagedKeyArgs;
import com.pulumi.azure.eventhub.inputs.NamespaceCustomerManagedKeyState;
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.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Manages a Customer Managed Key for a EventHub Namespace.
*
* !> **Note:** In 2.x versions of the Azure Provider during deletion this resource will **delete and recreate the parent EventHub Namespace which may involve data loss** as it's not possible to remove the Customer Managed Key from the EventHub Namespace once it's been added. Version 3.0 of the Azure Provider will change this so that the Delete operation is a noop, requiring the parent EventHub Namespace is deleted/recreated to remove the Customer Managed Key.
*
* ## Example Usage
*
* ### With System Assigned Identity
*
* <!--Start PulumiCodeChooser -->
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Customer Managed Keys for a EventHub Namespace can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:eventhub/namespaceCustomerManagedKey:NamespaceCustomerManagedKey example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.EventHub/namespaces/namespace1
* ```
*
*/
@ResourceType(type="azure:eventhub/namespaceCustomerManagedKey:NamespaceCustomerManagedKey")
public class NamespaceCustomerManagedKey extends com.pulumi.resources.CustomResource {
/**
* The ID of the EventHub Namespace. Changing this forces a new resource to be created.
*
*/
@Export(name="eventhubNamespaceId", refs={String.class}, tree="[0]")
private Output eventhubNamespaceId;
/**
* @return The ID of the EventHub Namespace. Changing this forces a new resource to be created.
*
*/
public Output eventhubNamespaceId() {
return this.eventhubNamespaceId;
}
/**
* Whether to enable Infrastructure Encryption (Double Encryption). Changing this forces a new resource to be created.
*
*/
@Export(name="infrastructureEncryptionEnabled", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> infrastructureEncryptionEnabled;
/**
* @return Whether to enable Infrastructure Encryption (Double Encryption). Changing this forces a new resource to be created.
*
*/
public Output> infrastructureEncryptionEnabled() {
return Codegen.optional(this.infrastructureEncryptionEnabled);
}
/**
* The list of keys of Key Vault.
*
*/
@Export(name="keyVaultKeyIds", refs={List.class,String.class}, tree="[0,1]")
private Output> keyVaultKeyIds;
/**
* @return The list of keys of Key Vault.
*
*/
public Output> keyVaultKeyIds() {
return this.keyVaultKeyIds;
}
/**
* The ID of a User Managed Identity that will be used to access Key Vaults that contain the encryption keys.
*
* > **Note:** If using `user_assigned_identity_id`, ensure the User Assigned Identity is also assigned to the parent Event Hub.
*
* > **Note:** If using `user_assigned_identity_id`, make sure to assign the identity the appropriate permissions to access the Key Vault key. Failure to grant `Get, UnwrapKey, and WrapKey` will cause this resource to fail to apply.
*
*/
@Export(name="userAssignedIdentityId", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> userAssignedIdentityId;
/**
* @return The ID of a User Managed Identity that will be used to access Key Vaults that contain the encryption keys.
*
* > **Note:** If using `user_assigned_identity_id`, ensure the User Assigned Identity is also assigned to the parent Event Hub.
*
* > **Note:** If using `user_assigned_identity_id`, make sure to assign the identity the appropriate permissions to access the Key Vault key. Failure to grant `Get, UnwrapKey, and WrapKey` will cause this resource to fail to apply.
*
*/
public Output> userAssignedIdentityId() {
return Codegen.optional(this.userAssignedIdentityId);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public NamespaceCustomerManagedKey(java.lang.String name) {
this(name, NamespaceCustomerManagedKeyArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public NamespaceCustomerManagedKey(java.lang.String name, NamespaceCustomerManagedKeyArgs 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 NamespaceCustomerManagedKey(java.lang.String name, NamespaceCustomerManagedKeyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:eventhub/namespaceCustomerManagedKey:NamespaceCustomerManagedKey", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private NamespaceCustomerManagedKey(java.lang.String name, Output id, @Nullable NamespaceCustomerManagedKeyState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:eventhub/namespaceCustomerManagedKey:NamespaceCustomerManagedKey", name, state, makeResourceOptions(options, id), false);
}
private static NamespaceCustomerManagedKeyArgs makeArgs(NamespaceCustomerManagedKeyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? NamespaceCustomerManagedKeyArgs.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())
.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 NamespaceCustomerManagedKey get(java.lang.String name, Output id, @Nullable NamespaceCustomerManagedKeyState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new NamespaceCustomerManagedKey(name, id, state, options);
}
}