Author Archives: anuj - Page 2
Using -out with terraform plan – terraform plan -out
This is a short post - always use the -out option. This saves the current plan - and will execute it exactly as saved (once you pass in the saved…
Data Block External Data – Querying External Resources in Terraform
Retrieving External data Use either the data block or the terraform_remote_state block to retrieve external data. However, there are scenarios where the data block does not exist in the provider or terraform_remote_state cannot be used, such as…
Referencing outputs from one terraform file in another terraform file
Split Configuration across multiple files You can (and should) split resources across multiple files (even folders, if you so desire). The entire deployment will have a single state file managing…
data.azurerm_client_config.current.object_id returns null “”
You may be using the current client config object to retrieve the current user's object id. And that used to work just fine. object_id = However, for me, this…
Error: Error decoding “admin_ssh_key.0.public_key” for public key data
This is an error I encountered while trying to set the admin ssh key for a linux instance - and attempting to use an existing pub key in my .ssh…
What if there is no Terraform Support for certain GCP Features?
Sometimes, there isn't Terraform GCP support for a particular feature - use asset manager to retrieve all resources, upload of a file to a Kubernetes pod) that lacks Terraform support.…
More on Remote State and State Files
State File Locking is something terraform does by default. But what if the actual backend does not support locking ( S3 by itself doesn't - S3 with DynamoDB does). If…
Manual Drift and terraform
Also read - Preventing accidental deletion of resources Prevent_Destroy in Terraform Terraform has a few options for detecting and managing drift of resources. lifecycle { prevent_destroy = true } However,…
Multi User Edits and Terraform State file
What if you have users are working on the same terraform project (they don't need to work directly on the state file)? How does the state file know which changes…
Terraform SaaS versus Terraform Enterprise (TFE)
This is a work in How does Terraform Cloud SaaS work? Through IP Range API and Remote Access Licensing TFE licensing is per workspace (state files) License for SaaS is…