Skip to content

Instantly share code, notes, and snippets.

region1="us-central1"
region2="us-east4"
vpc_network="private-network"
project="<project-id>"
variable "region1" {
default = "us-central1"
}
variable "region2" {
default = "us-east4"
}
variable "project" {
default = "<project-id>" # Replace with your project Id here
terraform {
backend "gcs" {
bucket = "<project-id>-tfstate" ## replace with a GCS bucket name
prefix = "tfsql/"
}
}
resource "random_id" "db_name_suffix_master" {
byte_length = 2
}
@valavan007
valavan007 / .gitlab-ci.yml
Last active November 1, 2022 01:37
Gitlab CI file
image:
name: hashicorp/terraform:light
entrypoint:
- '/usr/bin/env'
- 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
before_script:
- rm -rf .terraform
- terraform --version
#- mkdir -p ./creds
@valavan007
valavan007 / main.tf
Last active November 1, 2022 01:35
cloud sql relica terraform
terraform {
backend "gcs" {
bucket = "<project-id>-tfstate" ## replace with a GCS bucket name
prefix = "tfsql/"
}
}
resource "random_id" "db_name_suffix_master" {
byte_length = 2
}