Dependencies
- Have terraform running on your workstation
- Already setup authentication from workstation to GCP
- Have a file called
credentials.json
to be used to authenticate with GCP - Create private and public key which will be used for logging in the workstation.
There is a cloud-storage
folder which contains the terraform codes for creating the cloud-storage to keep the terraform state files.
The state files are kept in the google cloud storage
-
Firstly run terraform init, terraform plan on the
cloud-storage
folder to keep the statefile. -
Once terraform apply finished running from
cloud-storage
it will create cloud storage. -
Put the details of the s3 bucket in
sql\versions.tf
line 3 -
Replace values.tfvars files with the correspoinding correct values.
-
cd into sql folder and run terraform init, terraform plan -var-file=values.tfvars, terraform apply -var-file=values.tfvars