Azure Storage Table Entity
This page shows how to write Terraform for Storage Table Entity and write them securely.
azurerm_storage_table_entity (Terraform)
The Table Entity in Storage can be configured in Terraform with the resource name azurerm_storage_table_entity
. The following sections describe 9 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_storage_table_entity" "demotableentry1" {
storage_account_name = azurerm_storage_account.data.name
table_name = azurerm_storage_table.demo.name
partition_key = "AAA"
row_key = "BBB"
resource "azurerm_storage_table_entity" "demotableentry1" {
storage_account_name = azurerm_storage_account.data.name
table_name = azurerm_storage_table.demo.name
partition_key = "AAA"
row_key = "BBB"
resource "azurerm_storage_table_entity" "demotableentry1" {
storage_account_name = azurerm_storage_account.data.name
table_name = azurerm_storage_table.demo.name
partition_key = "AAA"
row_key = "BBB"
resource "azurerm_storage_table_entity" "subscription" {
storage_account_name = var.storage
table_name = var.table
partition_key = var.partition_key
row_key = var.row_key
resource "azurerm_storage_table_entity" "this" {
entity = var.entity
partition_key = var.partition_key
row_key = var.row_key
storage_account_name = var.storage_account_name
table_name = var.table_name
resource "azurerm_storage_table_entity" "queries" {
for_each = local.log_queries
storage_account_name = module.function.storage_account_name
table_name = azurerm_storage_table.queries.name
resource "azurerm_storage_table_entity" "this" {
entity = var.entity
partition_key = var.partition_key
row_key = var.row_key
storage_account_name = var.storage_account_name
table_name = var.table_name
resource "azurerm_storage_table_entity" "storage_table_entity_configuration_prod" {
storage_account_name = azurerm_storage_account.storage_account.name
table_name = azurerm_storage_table.storage_table_configuration.name
partition_key = "global"
row_key = "prod"
resource "azurerm_storage_table_entity" "config" {
storage_account_name = azurerm_storage_account.scalingstorageaccount.name
table_name = azurerm_storage_table.scalingconfig.name
partition_key = "partition1"
row_key = var.sapsid
for_each = var.scalingconfig
Parameters
-
entity
required - map from string to string -
id
optional computed - string -
partition_key
required - string -
row_key
required - string -
storage_account_name
required - string -
table_name
required - string -
timeouts
single block
Explanation in Terraform Registry
Manages an Entity within a Table in an Azure Storage Account.
Tips: Best Practices for The Other Azure Storage Resources
In addition to the azurerm_storage_account, Azure Storage has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.
azurerm_storage_account
Ensure to use HTTPS connections
It is better to use HTTPS instead of HTTP, which could be vulnerable to person-in-the-middle attacks.
azurerm_storage_account_network_rules
Ensure to allow Trusted Microsoft Services to bypass
It is better to allow Trusted Microsoft Services to bypass. They are not able to access storage account unless rules are set to allow them explicitly.
Azure Resource Manager Example
Azure Resource Manager code does not have the related resource.
Frequently asked questions
What is Azure Storage Table Entity?
Azure Storage Table Entity is a resource for Storage of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure Storage Table Entity?
For Terraform, the fortunkam/webapp-serviceendpoint, fortunkam/webapp-privatelink and fortunkam/asev3-firewall-appgateway source code examples are useful. See the Terraform Example section for further details.