Deploy on Google Cloud Engine
Installing Agenta on GCP Compute Engine using terraform
GCP
We provide a Terraform module to deploy Agenta on GCP. You can find it here. The terraform module will in the in us-central1 region create;
- An e2-medium Compute instance
- VPC Network
- Firewall configured to allow ports 22 (ssh), 80 (http), and 443 (https)
You can customize the module according to your needs.
Prerequisites
- Install Terraform: First, install Terraform.
-
Setup Project; In the Google cloud Console, on the project selector page, select or create a Google Cloud project, then copy and save the Project ID for later.
-
Confirm Billing; Make sure that billing is enabled for your Google Cloud project.
-
Create a Service account; Click here to Create a Service account and specify the compute admin role.
-
Get Service account key; Click here to obtain the keys for the service account you created.
-
Enable Google Compute Engine API: Navigate to Compute Engine API and make sure to select the correct project at the top, then enable Compute Engine API.
-
Copy the content of the downloaded key file and replace the content of credentials.json with it.
-
Initialize and Apply Terraform: Navigate to the correct directory and run:
cd self-host/gcp terraform init terraform apply
SSH into the instance:
In order to ssh into the instance you need to:
- Uncomment these lines in the Terraform instance file
metadata = {
ssh-keys = "YOUR_USERNAME:${file("~/.ssh/id_rsa.pub")}"
}
-
Rerun
terraform apply.
Remember that while allowing SSH access from any source (0.0.0.0/0) is convenient for testing, it’s not recommended for production environments due to security concerns. In production, you would restrict SSH access to specific trusted IP addresses.
Removing All Resources:
To delete all the resources created by Terraform, simply run
cd self-host/gcp
terraform destroy
Was this page helpful?