Skip to content

azurermStorageTableEntity

Manages an Entity within a Table in an Azure Storage Account.

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";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "azureexample",
  }
);
const azurermStorageAccountExample = new azurerm.storageAccount.StorageAccount(
  this,
  "example_1",
  {
    account_replication_type: "LRS",
    account_tier: "Standard",
    location: azurermResourceGroupExample.location,
    name: "azureexamplestorage1",
    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 azurermStorageTableExample = new azurerm.storageTable.StorageTable(
  this,
  "example_2",
  {
    name: "myexampletable",
    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.*/
azurermStorageTableExample.overrideLogicalId("example");
const azurermStorageTableEntityExample =
  new azurerm.storageTableEntity.StorageTableEntity(this, "example_3", {
    entity: [
      {
        example: "example",
      },
    ],
    partition_key: "examplepartition",
    row_key: "examplerow",
    storage_account_name: azurermStorageAccountExample.name,
    table_name: azurermStorageTableExample.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.*/
azurermStorageTableEntityExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • storageAccountName - (Required) Specifies the storage account in which to create the storage table entity. Changing this forces a new resource to be created.

  • tableName - (Required) The name of the storage table in which to create the storage table entity. Changing this forces a new resource to be created.

  • partitionKey - (Required) The key for the partition where the entity will be inserted/merged. Changing this forces a new resource.

  • rowKey - (Required) The key for the row where the entity will be inserted/merged. Changing this forces a new resource.

  • entity - (Required) A map of key/value pairs that describe the entity to be inserted/merged in to the storage table.

Attributes Reference

The following attributes are exported in addition to the arguments listed above:

  • id - The ID of the Entity within the Table in the Storage Account.

Timeouts

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

  • create - (Defaults to 30 minutes) Used when creating the Storage Table Entity.
  • update - (Defaults to 30 minutes) Used when updating the Storage Table Entity.
  • read - (Defaults to 5 minutes) Used when retrieving the Storage Table Entity.
  • delete - (Defaults to 30 minutes) Used when deleting the Storage Table Entity.

Import

Entities within a Table in an Azure Storage Account can be imported using the resourceId, e.g.

terraform import azurerm_storage_table_entity.entity1 https://example.table.core.windows.net/table1(PartitionKey='samplepartition',RowKey='samplerow')