Skip to content

azurermHpcCacheBlobTarget

Manages a Blob Target within a HPC Cache.

\~> NOTE:: By request of the service team the provider no longer automatically registering the microsoftStorageCache Resource Provider for this resource. To register it you can run azProviderRegisterNamespace 'microsoftStorageCache'.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
import * as azuread from "./.gen/providers/azuread";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm, azuread.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermStorageAccountExample = new azurerm.storageAccount.StorageAccount(
  this,
  "example_1",
  {
    account_replication_type: "LRS",
    account_tier: "Standard",
    location: azurermResourceGroupExample.location,
    name: "examplestorgaccount",
    resource_group_name: azurermResourceGroupExample.name,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermStorageAccountExample.overrideLogicalId("example");
const azurermStorageContainerExample =
  new azurerm.storageContainer.StorageContainer(this, "example_2", {
    name: "examplestoragecontainer",
    storage_account_name: azurermStorageAccountExample.name,
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermStorageContainerExample.overrideLogicalId("example");
const azurermVirtualNetworkExample = new azurerm.virtualNetwork.VirtualNetwork(
  this,
  "example_3",
  {
    address_space: ["10.0.0.0/16"],
    location: azurermResourceGroupExample.location,
    name: "examplevn",
    resource_group_name: azurermResourceGroupExample.name,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermVirtualNetworkExample.overrideLogicalId("example");
const dataAzureadServicePrincipalExample =
  new azuread.dataAzureadServicePrincipal.DataAzureadServicePrincipal(
    this,
    "example_4",
    {
      display_name: "HPC Cache Resource Provider",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
dataAzureadServicePrincipalExample.overrideLogicalId("example");
new azurerm.roleAssignment.RoleAssignment(
  this,
  "example_storage_account_contrib",
  {
    principal_id: dataAzureadServicePrincipalExample.objectId,
    role_definition_name: "Storage Account Contributor",
    scope: azurermStorageAccountExample.id,
  }
);
new azurerm.roleAssignment.RoleAssignment(
  this,
  "example_storage_blob_data_contrib",
  {
    principal_id: dataAzureadServicePrincipalExample.objectId,
    role_definition_name: "Storage Blob Data Contributor",
    scope: azurermStorageAccountExample.id,
  }
);
const azurermSubnetExample = new azurerm.subnet.Subnet(this, "example_7", {
  address_prefixes: ["10.0.1.0/24"],
  name: "examplesubnet",
  resource_group_name: azurermResourceGroupExample.name,
  virtual_network_name: azurermVirtualNetworkExample.name,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermSubnetExample.overrideLogicalId("example");
const azurermHpcCacheExample = new azurerm.hpcCache.HpcCache(
  this,
  "example_8",
  {
    cache_size_in_gb: 3072,
    location: azurermResourceGroupExample.location,
    name: "examplehpccache",
    resource_group_name: azurermResourceGroupExample.name,
    sku_name: "Standard_2G",
    subnet_id: azurermSubnetExample.id,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermHpcCacheExample.overrideLogicalId("example");
const azurermHpcCacheBlobTargetExample =
  new azurerm.hpcCacheBlobTarget.HpcCacheBlobTarget(this, "example_9", {
    cache_name: azurermHpcCacheExample.name,
    name: "examplehpccblobtarget",
    namespace_path: "/blob_storage",
    resource_group_name: azurermResourceGroupExample.name,
    storage_container_id: azurermStorageContainerExample.resourceManagerId,
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermHpcCacheBlobTargetExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • cacheName - (Required) The name HPC Cache, which the HPC Cache Blob Target will be added to. Changing this forces a new resource to be created.

  • name - (Required) The name of the HPC Cache Blob Target. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) The name of the Resource Group in which to create the HPC Cache Blob Target. Changing this forces a new resource to be created.

  • namespacePath - (Required) The client-facing file path of the HPC Cache Blob Target.

  • storageContainerId - (Required) The Resource Manager ID of the Storage Container used as the HPC Cache Blob Target. Changing this forces a new resource to be created.

-> Note: This is the Resource Manager ID of the Storage Container, rather than the regular ID - and can be accessed on the azurermStorageContainer Data Source/Resource as resourceManagerId.

  • accessPolicyName - (Optional) The name of the access policy applied to this target. Defaults to default.

Attributes Reference

The following attributes are exported:

  • id - The ID of the HPC Cache Blob Target.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the HPC Cache Blob Target.
  • read - (Defaults to 5 minutes) Used when retrieving the HPC Cache Blob Target.
  • update - (Defaults to 30 minutes) Used when updating the HPC Cache Blob Target.
  • delete - (Defaults to 30 minutes) Used when deleting the HPC Cache Blob Target.

Import

Blob Targets within an HPC Cache can be imported using the resourceId, e.g.

terraform import azurerm_hpc_cache_blob_target.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.StorageCache/caches/cache1/storageTargets/target1