-
Sample Terraform Code to Manage Temporary Access to GCP
TL; DR: This is a way to grant a temporary access to some GCP resources using Terraform’s time_static and google_project_iam_member resources. 🙂
-
How to Use YAML as Data Source in Terraform
I love how DRY and lean YAML can be, since I started to learn Ansible years ago. Recently I wanted to provision MySQL user privileges right after the database instance provisioned in Google Cloud SQL. I used petoju/mysql Terraform provider to get the job done, it’s a community provider but seemed to be quite popular. […]
-
Passing Environment Variables to Terraform with RegExp
In a Terraform template, an input variable can be used to set some configuration point for a resource, such as In some scenario the input variable can get its value from an environment variable in the shell where terraform runs. It looks like This is handy where there is just a few variables. If there […]
-
Update GCP IAM Adaptively with Terraform DataSources
In a scenario where a service account in a central GCP project needs to be accessible by a group of GKE service accounts across multiple GCP projects, the IAM part in Terraform HCL could look like I can make a variable for the members so it becomes But still the project_ids variable needs to be […]