You'll learn how to enable a MultiCloud architecture deployment through Terraform, with resources running in AWS and Google Cloud Platform.
An AWS account
A Google Cloud Account GCP (For GCP) Open your browser in an Anonymous | Private | Cognito way and go to:
https://console.cloud.google.com/freetrial
Advice: We strongly recommend creating a new Gmail account, instead of using your personal!
-
Access the AWS console (https://aws.amazon.com) and log in with your newly created account. In the search bar, type IAM. In the Services section, click on IAM.
-
Click on Users and then Add users, enter the name terraform-en-1, and click Next to create a programmatic type user.

-
After advancing, in Set permissions, click on the Attach existing policies directly button.
-
Type AmazonS3FullAccess in Search.
-
Click on Next
-
Review all the details
-
Click on Create user
- Access the terraform-en-1 user

- Click on the Security credentials tab

- Navigate to the Access keys section
- Click on Create access key

- Select Command Line Interface (CLI) and I understand the above recommendation and want to proceed to create an access key.

- Click on Next.
- Click on Create access key
Click on Download .csv file

- After the download finishes, click on Done.
- Once the download is complete, rename the .csv file to key.csv
-
Access the Google Cloud Console (console.cloud.google.com) and log in with your newly created account
-
Download the mission1.zip file in the Google Cloud shell using the wget command
wget https://tcb-public-events.s3.amazonaws.com/icp/mission1.zip
-
Upload the key.csv and mission1.zip files to the Cloud Shell using the browser
-
Verify if the mission1.zip and key.csv files are in the folder in the Cloud Shell using the command below
ls
- Execute the file preparation commands:
mkdir mission1_en
mv mission1.zip mission1_en
cd mission1_en
unzip mission1.zip
mv key.csv mission1/en
cd mission1/en
chmod +x *.sh
-
Execute the commands below to prepare the AWS and GCP environment
mkdir -p ~/.aws/
touch ~/.aws/credentials_multiclouddeploy
./aws_set_credentials.sh key.csv
gcloud config set project <GOOGLE_CLOUD_PROJECT_ID>
NOTE: To get Project ID and EDIT the <GOOGLE_CLOUD_PROJECT_ID>
-
Drag down the Cloud shell
-
COPY your project ID and past on the terminal of the Cloud shell

-
Execute the command below to set the project in the Google Cloud Shell
./gcp_set_project.sh
-
Execute the commands to enable the Kubernetes, Container Registry, and Cloud SQL APIs
gcloud services enable containerregistry.googleapis.com
gcloud services enable container.googleapis.com
gcloud services enable sqladmin.googleapis.com
-
Go to the right-hand-side of your Google Cloud shell terminal
-
Click on Mission1 folder
-
Click on Terraform folder
-
Click on tcb_aws_storage.tf and edit the LINE 4 XXXX with unique number of your choice(This is because AWS requires you to create a unique name for your Aws S3 Buckets)
AFTER EDITING RETURN TO THE CLOUD SHELL TERMINAL
- Execute the following commands to provision infrastructure resources
cd ~/mission1/en/terraform/
terraform init
terraform plan
terraform apply
Attention: The provisioning process can take between 15 to 25 minutes to finish. Keep the CloudShell open during the process. If disconnected, click on Reconnect when the session expires (the session expires after 5 minutes of inactivity by default)
- Search and Click on the SQL instance that has been created in the Google Cloud Platform using Terraform
- Click on Connections
- Under the Networking section, Check-box the Private IP
- Under the Private IP; On the network dropdown, Select default
- Go down and Click on ADD NETWORK
- NAME: Public Access (Testing Only)
- NETWORK: 0.0.0.0/0
- Click Done
- Scroll down and click on Save
In case you have encountered any problem/error and want to reset the environment to start over, follow the step-by-step instructions below to remove the entire MultiCloud environment.
cd ~/mission1/en/terraform/ terraform destroy
cd ~
rm -rf mission*
cd ~
rm -rf mission*
rm -rf .ssh
- For production environments, it's recommended to use only the Private Network for database access.
- Never provide public network access (0.0.0.0/0) to production databases.
⚠️
By reaching this point, you have completed the implementation of the first part of the Hands-on Project and have implemented resources in a MultiCloud (AWS and Google Cloud) environment using Terraform!
Congratulations! 🚀🎉
















