First steps:Terraform Files - How to Structure Terraform Project
Simplify variables
Variables for Modules - Terraform - HashiCorp Discuss
Rename resource in terraform via terrform state mv
Store state file in azure: Store Terraform state in Azure Storage | Microsoft Learn and service or managed identities: Always store the Terraform state in Azure blob Storage | by Anoop Srivastava | Medium in Azure you don’t need to use CosmoDB because Azure storage account natively supports state locking and leasing in blob storage types.
Features{} block in Azure: Terraform Registry
Upload file to azure storage file: Is it possible to upload files to Azure Share using terraform? - Stack Overflow and blob Terraform Registry
Using provisioner is the last measure, look into provider specific for each clauses and global meta arguments: Provisioners | Terraform | HashiCorp Developer
Multiregion deployment by using Aliases: Deploy AWS Resources in Different AWS Account and Multi-Region with Terraform Multi-Provider and Alias - DEV Community
required_providers is used to set version while provider confiures the provider itself, like subscription, “domain” or identity role used
Outputs
They can access data without managing in Terraform, which is funny.
Terraform file types include:
- main.tf – containing the resource blocks that define the resources to be created in the target cloud platform.
- variables.tf – containing the variable declarations used in the resource blocks.
- provider.tf – may containing the terraform block, s3 backend definition, provider configurations, and aliases or other provider configurations
- output.tf – containing the output that needs to be generated on successful completion of “apply” operation.
- *.tfvars – containing the environment-specific default values of variables.