feat: Add Terraform configuration for Google Cloud project

This commit is contained in:
2025-10-30 20:53:56 -07:00
parent 5eff7f39a4
commit c601abcc34
3 changed files with 78 additions and 0 deletions

32
main.tf Normal file
View File

@@ -0,0 +1,32 @@
# Configure the Google Cloud provider
provider "google" {
project = var.project_id
region = var.region
}
# Create a new Google Cloud Project
resource "google_project" "main_project" {
name = var.project_name
project_id = var.project_id
# Enable deletion policy to allow project deletion
deletion_policy = "DELETE"
}
# Enable required APIs for the project
resource "google_project_service" "project_services" {
project = google_project.main_project.project_id
service = "cloudresourcemanager.googleapis.com"
# Wait for the project to be created before enabling services
depends_on = [google_project.main_project]
}
# Output the project ID and name
output "project_id" {
value = google_project.main_project.project_id
}
output "project_name" {
value = google_project.main_project.name
}