Prerequisite:
- GCP Account
- Install Google Cloud SDK
- Terraform Installed on Developer Desktop
- Python on Developer Desktop
In GCP Console:
We will enable the following APIs for our project to work, run the below mentioned commands in Google Cloud CLI
On Developer Desktop:
- Create a simple Flask Application
-
Create an
app.py
file
-
Create a
Dockerfile
In GCP Console:
- Go to Artifact Registry
- Click on Create Repository
- Give name to repository (
$REPO_NAME
) - Select Docker in Format
- Select Standard in Mode
- Select Regional in Location Type
- Select us-west1 in Region
- Click on Create
On Developer Desktop
In the folder where we created the
Dockerfile
; run the following commands
We will create Terraform project
-
Create
terraform.tf
for configuring the providers
-
Create
main.tf
containing the cloud run configuration
-
Create
variable.tf
containing the variables
-
Create
data.tf
containing the data
-
Create
output.tf
containing the output
-
Create
terraform.tfvars
containing the variable values
Output
Destroy Infrastructure
To destroy the infrastructure, run the following commands in your terminal
ššBYEšš
Top comments (4)
Very helpful and informative!
Crisp and perfect! Thanks for sharing this!
Gr8 content š
Helpful for beginners šÆ