Mohan Golla
4 min readDec 17, 2023

Deployment of a Private Communication in a MultiCloud Environment (AWS and GCP) 100% Automated Using Terraform

In another project based on a real-world scenario, I acted as a Cloud Specialist in a company that used Google Cloud and AWS services in separate architectures.

The company decided to interconnect the two architectures, in a completely private way, using the Virtual Private Gateway, Customer Gateway, Cloud Routers, Cloud VPN, among other services.

However, they needed it in production in a week. So, once GCP and AWS accounts were created, to save time, I decided to deploy it in a 100% automated way using Terraform.

Created a new project and enabled the access to APIs

Created a private key for the service account and set the credentials for the project in the Google Cloud

Created a new user to provision infrastructure on AWS and created the key in AWS and uploaded to Google Cloud (the authentication files are ready)

Now on Google cloud shell run AWS set credentials so that script and pass the access key as arugment so that it can create a new AWS credentials path in the varaibles file so that it is populated inside the Terraform folder

Created a new ssh key so that we have private and public key

Imported the private key vm-ssh-key to AWS

Downloaded public key vm-ssh-key from Google Cloud to my machine and imported to AWS

Public key imported to AWS

Now prepared all files and prerequisites for both Google Cloud and AWS for the Terraform to execute the code on Google Cloud to provision the infrastructure.

Terraform init

Terraform plan — runs in a parallel way instead of sequentially to create all the resources on Google Cloud and AWS.

Virtual machine on AWS

SSH in Google Cloud to the private ip address of AWS EC2 instance

Connectivity Test in Google Cloud is able to connect to AWS

Now we can see how critical this exercise is as a successful network communication between all the components and resources on both Google Cloud and AWS or any other Cloud providers is the Key to the success of any MultiCloud project. Amazing!!!

Mohan Golla
Mohan Golla

No responses yet