Below you will find pages that utilize the taxonomy term “Terraform”
Reverse engineering an existing GCP project with terraformer
It can be tough to try to reverse engineer an existing project that has never used terraform. Terraformer can look at an existing project and generate the corresponding terraform code for you. I tried it out on an existing legacy project which used Google Cloud Storage, BigQuery and various service accounts. The setup was a little tricky so I put together a script to simply things. The script assumes you have gcloud setup or a service account key/impersonation and you may need to adjust the –resources parameter.
Terraform Cloud Development Kit
Terraform’s Cloud Development Kit (CDK) let’s you use other languages to define your cloud infra.
https://github.com/hashicorp/terraform-cdk/blob/master/examples/
Cloud Billing Budget API in beta
You can finally set budgets via the API in GCP. This is a huge relief to all those org admins out there who have had to do this manually.
AND, hold on to your hats, there’s terraform support as well!
Looks like Christmas came late….
data "google_billing_account" "account" {
provider = google-beta
billing_account = "000000-0000000-0000000-000000"
}
resource "google_billing_budget" "budget" {
provider = google-beta
billing_account = data.google_billing_account.account.id
display_name = "Example Billing Budget"
amount {
specified_amount {
currency_code = "USD"
units = "100000"
}
}
threshold_rules {
threshold_percent = 0.5
}
}
Managing GCP projects with Terraform
An invaluable start on how to start managing GCP projects with Terraform. I wish I’d found this a year ago.
Terraform init in the real world
Rather than fully configuring your backend.tf in a file.```
terraform {
backend “gcs” {
bucket = “my-bucket-123”
prefix = “terraform/state”
}
I prefer to use the command line in order avoid polluting the code with any environment specific names.
terraform init \
-backend-config=“bucket=my-bucket-123” \
-backend-config=“prefix=terraform/state
Opinionated Google Cloud Platform projects
I’m glad Google are finally starting to embrace Terraform by creating their own modules. Version 0.1.0 of the project-factory looks really promising.