Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
The error shown is a Terraform syntax error in main.tf, not a Cloud Shell provisioning issue.
terraform init validates the configuration enough to determine which providers and modules are needed. In this case, Terraform found an unclosed configuration block:
Error: Unclosed configuration block
on main.tf line 39, in resource "azurerm_storage_container_immutability_policy" "example":
39: resource "azurerm_storage_container_immutability_policy" "example" {
There is no closing brace for this block before the end of the file.
Fix it with these steps:
- Open
main.tfin Cloud Shell.nano main.tf - Go to the block that starts on line 39:
resource "azurerm_storage_container_immutability_policy" "example" { - Check that every opening
{has a matching closing}. The error means this resource block is missing a closing brace before the end of the file, or another block earlier in the file has incorrect brace nesting. - Save the file and run:
terraform init - If the error still points to the same line, review the blocks above line 39 as well. Terraform states that incorrect brace nesting elsewhere in the file can cause the same message.
For a new Cloud Shell setup, also verify Terraform is available and current:
terraform version
Cloud Shell updates Terraform automatically, but updates can lag by a couple of weeks. If needed, install the current version in Cloud Shell with:
curl -O <terraform_download_url>
unzip <zip_file_downloaded_in_previous_step>
mkdir bin
mv terraform bin/
Then close and restart Cloud Shell, and verify again:
terraform version
Before creating resources in a new subscription, verify the active subscription used by Cloud Shell:
az account show
Terraform automatically authenticates by using the default Azure subscription shown there.