This repo gets you up and running in GCP.
- Creates a minimal network and subnet
- Creates a Cloud NAT for egress to the internet
- Creates two small VM's to test HTTP requests
-
Create a GCP Project
-
While it's possible to Terraform the project itself, the attachment of the billing account doesn't propagate in time and results in a mess of null resource dependencies and sleeping...
-
...with that said, create a new GCP Project using the web console
-
Make sure you set the billing account and folder
-
-
Install the
gcloudCLI -
Install Terraform
-
Clone this repo
-
Initialize
terraform init -
Login using the CLI
gcloud auth application-default login. Alternatively you can authenticate as a service account.
This will deploy all the resources in main.tf.
-
Edit
terraform.tfvarsto include your project id and desired settings. -
Deploy your infrastructure
terraform plan terraform apply -
SSH to the consumer instance using IAP tunneling
gcloud compute ssh nginx-consumer -
Make a request to the Nginx web server, you should see some HTML as a result that has
Thank you for using nginxin it.curl nginx exit -
You can now SSH to the Nginx web server and edit configs as needed.
gcloud compute ssh nginx