Azure Storage Container
This page shows how to write Terraform for Storage Container and write them securely.
azurerm_storage_container (Terraform)
The Container in Storage can be configured in Terraform with the resource name azurerm_storage_container
. The following sections describe 1 example of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_storage_container" "dev" {
name = "source"
storage_account_name = azurerm_storage_account.dev.name
container_access_type = "private"
}
Parameters
-
container_access_type
optional - string -
has_immutability_policy
optional computed - bool -
has_legal_hold
optional computed - bool -
id
optional computed - string -
metadata
optional computed - map from string to string -
name
required - string -
resource_manager_id
optional computed - string -
storage_account_name
required - string -
timeouts
single block
Explanation in Terraform Registry
Manages a Container within 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 Container?
Azure Storage Container 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 Container?
For Terraform, the ErnstRoell/devops-adf source code example is useful. See the Terraform Example section for further details.