forked from pierront/but3-iac
574 lines
26 KiB
Plaintext
574 lines
26 KiB
Plaintext
|
|
# module.compute.google_compute_instance.backend:
|
||
|
|
resource "google_compute_instance" "backend" {
|
||
|
|
can_ip_forward = false
|
||
|
|
cpu_platform = "Intel Broadwell"
|
||
|
|
creation_timestamp = "2025-12-04T00:48:44.369-08:00"
|
||
|
|
current_status = "RUNNING"
|
||
|
|
deletion_protection = false
|
||
|
|
description = null
|
||
|
|
effective_labels = {
|
||
|
|
"goog-terraform-provisioned" = "true"
|
||
|
|
}
|
||
|
|
enable_display = false
|
||
|
|
hostname = null
|
||
|
|
id = "projects/projet1-478713/zones/europe-west2-a/instances/backend-instance"
|
||
|
|
instance_id = "1872714282255053828"
|
||
|
|
key_revocation_action_type = null
|
||
|
|
label_fingerprint = "vezUS-42LLM="
|
||
|
|
labels = {}
|
||
|
|
machine_type = "e2-small"
|
||
|
|
metadata = {
|
||
|
|
"enable-oslogin" = "TRUE"
|
||
|
|
}
|
||
|
|
metadata_fingerprint = "_bvMMHZ9GDQ="
|
||
|
|
min_cpu_platform = null
|
||
|
|
name = "backend-instance"
|
||
|
|
project = "projet1-478713"
|
||
|
|
resource_policies = []
|
||
|
|
self_link = "https://www.googleapis.com/compute/v1/projects/projet1-478713/zones/europe-west2-a/instances/backend-instance"
|
||
|
|
tags = [
|
||
|
|
"backend",
|
||
|
|
"ssh",
|
||
|
|
]
|
||
|
|
tags_fingerprint = "N2bbCLFli_k="
|
||
|
|
terraform_labels = {
|
||
|
|
"goog-terraform-provisioned" = "true"
|
||
|
|
}
|
||
|
|
zone = "europe-west2-a"
|
||
|
|
|
||
|
|
boot_disk {
|
||
|
|
auto_delete = true
|
||
|
|
device_name = "persistent-disk-0"
|
||
|
|
disk_encryption_key_raw = (sensitive value)
|
||
|
|
disk_encryption_key_sha256 = null
|
||
|
|
interface = null
|
||
|
|
kms_key_self_link = null
|
||
|
|
mode = "READ_WRITE"
|
||
|
|
source = "https://www.googleapis.com/compute/v1/projects/projet1-478713/zones/europe-west2-a/disks/backend-instance"
|
||
|
|
|
||
|
|
initialize_params {
|
||
|
|
enable_confidential_compute = false
|
||
|
|
image = "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-11-bullseye-v20251111"
|
||
|
|
labels = {}
|
||
|
|
provisioned_iops = 0
|
||
|
|
provisioned_throughput = 0
|
||
|
|
resource_manager_tags = {}
|
||
|
|
resource_policies = []
|
||
|
|
size = 10
|
||
|
|
storage_pool = null
|
||
|
|
type = "pd-standard"
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
network_interface {
|
||
|
|
internal_ipv6_prefix_length = 0
|
||
|
|
ipv6_access_type = null
|
||
|
|
ipv6_address = null
|
||
|
|
name = "nic0"
|
||
|
|
network = "https://www.googleapis.com/compute/v1/projects/projet1-478713/global/networks/vpc-terraform"
|
||
|
|
network_ip = "10.0.2.2"
|
||
|
|
nic_type = null
|
||
|
|
queue_count = 0
|
||
|
|
stack_type = "IPV4_ONLY"
|
||
|
|
subnetwork = "https://www.googleapis.com/compute/v1/projects/projet1-478713/regions/europe-west2/subnetworks/backend"
|
||
|
|
subnetwork_project = "projet1-478713"
|
||
|
|
}
|
||
|
|
|
||
|
|
scheduling {
|
||
|
|
automatic_restart = true
|
||
|
|
instance_termination_action = null
|
||
|
|
min_node_cpus = 0
|
||
|
|
on_host_maintenance = "MIGRATE"
|
||
|
|
preemptible = false
|
||
|
|
provisioning_model = "STANDARD"
|
||
|
|
}
|
||
|
|
|
||
|
|
shielded_instance_config {
|
||
|
|
enable_integrity_monitoring = true
|
||
|
|
enable_secure_boot = false
|
||
|
|
enable_vtpm = true
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
# module.compute.google_compute_instance.database:
|
||
|
|
resource "google_compute_instance" "database" {
|
||
|
|
can_ip_forward = false
|
||
|
|
cpu_platform = "Intel Broadwell"
|
||
|
|
creation_timestamp = "2025-12-04T00:48:44.280-08:00"
|
||
|
|
current_status = "RUNNING"
|
||
|
|
deletion_protection = false
|
||
|
|
description = null
|
||
|
|
effective_labels = {
|
||
|
|
"goog-terraform-provisioned" = "true"
|
||
|
|
}
|
||
|
|
enable_display = false
|
||
|
|
hostname = null
|
||
|
|
id = "projects/projet1-478713/zones/europe-west2-a/instances/database-instance"
|
||
|
|
instance_id = "1777970284412597252"
|
||
|
|
key_revocation_action_type = null
|
||
|
|
label_fingerprint = "vezUS-42LLM="
|
||
|
|
labels = {}
|
||
|
|
machine_type = "e2-small"
|
||
|
|
metadata = {
|
||
|
|
"enable-oslogin" = "TRUE"
|
||
|
|
}
|
||
|
|
metadata_fingerprint = "_bvMMHZ9GDQ="
|
||
|
|
min_cpu_platform = null
|
||
|
|
name = "database-instance"
|
||
|
|
project = "projet1-478713"
|
||
|
|
resource_policies = []
|
||
|
|
self_link = "https://www.googleapis.com/compute/v1/projects/projet1-478713/zones/europe-west2-a/instances/database-instance"
|
||
|
|
tags = [
|
||
|
|
"database",
|
||
|
|
"ssh",
|
||
|
|
]
|
||
|
|
tags_fingerprint = "22sTRfPQYj4="
|
||
|
|
terraform_labels = {
|
||
|
|
"goog-terraform-provisioned" = "true"
|
||
|
|
}
|
||
|
|
zone = "europe-west2-a"
|
||
|
|
|
||
|
|
boot_disk {
|
||
|
|
auto_delete = true
|
||
|
|
device_name = "persistent-disk-0"
|
||
|
|
disk_encryption_key_raw = (sensitive value)
|
||
|
|
disk_encryption_key_sha256 = null
|
||
|
|
interface = null
|
||
|
|
kms_key_self_link = null
|
||
|
|
mode = "READ_WRITE"
|
||
|
|
source = "https://www.googleapis.com/compute/v1/projects/projet1-478713/zones/europe-west2-a/disks/database-instance"
|
||
|
|
|
||
|
|
initialize_params {
|
||
|
|
enable_confidential_compute = false
|
||
|
|
image = "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-11-bullseye-v20251111"
|
||
|
|
labels = {}
|
||
|
|
provisioned_iops = 0
|
||
|
|
provisioned_throughput = 0
|
||
|
|
resource_manager_tags = {}
|
||
|
|
resource_policies = []
|
||
|
|
size = 20
|
||
|
|
storage_pool = null
|
||
|
|
type = "pd-standard"
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
network_interface {
|
||
|
|
internal_ipv6_prefix_length = 0
|
||
|
|
ipv6_access_type = null
|
||
|
|
ipv6_address = null
|
||
|
|
name = "nic0"
|
||
|
|
network = "https://www.googleapis.com/compute/v1/projects/projet1-478713/global/networks/vpc-terraform"
|
||
|
|
network_ip = "10.0.3.2"
|
||
|
|
nic_type = null
|
||
|
|
queue_count = 0
|
||
|
|
stack_type = "IPV4_ONLY"
|
||
|
|
subnetwork = "https://www.googleapis.com/compute/v1/projects/projet1-478713/regions/europe-west2/subnetworks/database"
|
||
|
|
subnetwork_project = "projet1-478713"
|
||
|
|
}
|
||
|
|
|
||
|
|
scheduling {
|
||
|
|
automatic_restart = true
|
||
|
|
instance_termination_action = null
|
||
|
|
min_node_cpus = 0
|
||
|
|
on_host_maintenance = "MIGRATE"
|
||
|
|
preemptible = false
|
||
|
|
provisioning_model = "STANDARD"
|
||
|
|
}
|
||
|
|
|
||
|
|
shielded_instance_config {
|
||
|
|
enable_integrity_monitoring = true
|
||
|
|
enable_secure_boot = false
|
||
|
|
enable_vtpm = true
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
# module.compute.google_compute_instance.frontend:
|
||
|
|
resource "google_compute_instance" "frontend" {
|
||
|
|
can_ip_forward = false
|
||
|
|
cpu_platform = "Intel Broadwell"
|
||
|
|
creation_timestamp = "2025-12-04T00:48:44.008-08:00"
|
||
|
|
current_status = "RUNNING"
|
||
|
|
deletion_protection = false
|
||
|
|
description = null
|
||
|
|
effective_labels = {
|
||
|
|
"goog-terraform-provisioned" = "true"
|
||
|
|
}
|
||
|
|
enable_display = false
|
||
|
|
hostname = null
|
||
|
|
id = "projects/projet1-478713/zones/europe-west2-a/instances/frontend-instance"
|
||
|
|
instance_id = "1320537421072102404"
|
||
|
|
key_revocation_action_type = null
|
||
|
|
label_fingerprint = "vezUS-42LLM="
|
||
|
|
labels = {}
|
||
|
|
machine_type = "e2-small"
|
||
|
|
metadata = {
|
||
|
|
"enable-oslogin" = "TRUE"
|
||
|
|
}
|
||
|
|
metadata_fingerprint = "_bvMMHZ9GDQ="
|
||
|
|
min_cpu_platform = null
|
||
|
|
name = "frontend-instance"
|
||
|
|
project = "projet1-478713"
|
||
|
|
resource_policies = []
|
||
|
|
self_link = "https://www.googleapis.com/compute/v1/projects/projet1-478713/zones/europe-west2-a/instances/frontend-instance"
|
||
|
|
tags = [
|
||
|
|
"frontend",
|
||
|
|
"ssh",
|
||
|
|
]
|
||
|
|
tags_fingerprint = "sermMtqzdso="
|
||
|
|
terraform_labels = {
|
||
|
|
"goog-terraform-provisioned" = "true"
|
||
|
|
}
|
||
|
|
zone = "europe-west2-a"
|
||
|
|
|
||
|
|
boot_disk {
|
||
|
|
auto_delete = true
|
||
|
|
device_name = "persistent-disk-0"
|
||
|
|
disk_encryption_key_raw = (sensitive value)
|
||
|
|
disk_encryption_key_sha256 = null
|
||
|
|
interface = null
|
||
|
|
kms_key_self_link = null
|
||
|
|
mode = "READ_WRITE"
|
||
|
|
source = "https://www.googleapis.com/compute/v1/projects/projet1-478713/zones/europe-west2-a/disks/frontend-instance"
|
||
|
|
|
||
|
|
initialize_params {
|
||
|
|
enable_confidential_compute = false
|
||
|
|
image = "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-11-bullseye-v20251111"
|
||
|
|
labels = {}
|
||
|
|
provisioned_iops = 0
|
||
|
|
provisioned_throughput = 0
|
||
|
|
resource_manager_tags = {}
|
||
|
|
resource_policies = []
|
||
|
|
size = 10
|
||
|
|
storage_pool = null
|
||
|
|
type = "pd-standard"
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
network_interface {
|
||
|
|
internal_ipv6_prefix_length = 0
|
||
|
|
ipv6_access_type = null
|
||
|
|
ipv6_address = null
|
||
|
|
name = "nic0"
|
||
|
|
network = "https://www.googleapis.com/compute/v1/projects/projet1-478713/global/networks/vpc-terraform"
|
||
|
|
network_ip = "10.0.1.2"
|
||
|
|
nic_type = null
|
||
|
|
queue_count = 0
|
||
|
|
stack_type = "IPV4_ONLY"
|
||
|
|
subnetwork = "https://www.googleapis.com/compute/v1/projects/projet1-478713/regions/europe-west2/subnetworks/frontend"
|
||
|
|
subnetwork_project = "projet1-478713"
|
||
|
|
|
||
|
|
access_config {
|
||
|
|
nat_ip = "35.246.11.135"
|
||
|
|
network_tier = "PREMIUM"
|
||
|
|
public_ptr_domain_name = null
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
scheduling {
|
||
|
|
automatic_restart = true
|
||
|
|
instance_termination_action = null
|
||
|
|
min_node_cpus = 0
|
||
|
|
on_host_maintenance = "MIGRATE"
|
||
|
|
preemptible = false
|
||
|
|
provisioning_model = "STANDARD"
|
||
|
|
}
|
||
|
|
|
||
|
|
shielded_instance_config {
|
||
|
|
enable_integrity_monitoring = true
|
||
|
|
enable_secure_boot = false
|
||
|
|
enable_vtpm = true
|
||
|
|
}
|
||
|
|
}
|
||
|
|
# module.iam.data.google_client_openid_userinfo.me:
|
||
|
|
data "google_client_openid_userinfo" "me" {
|
||
|
|
email = "tomy77690@gmail.com"
|
||
|
|
id = "tomy77690@gmail.com"
|
||
|
|
}
|
||
|
|
|
||
|
|
# module.iam.google_os_login_ssh_public_key.user_ssh_key:
|
||
|
|
resource "google_os_login_ssh_public_key" "user_ssh_key" {
|
||
|
|
expiration_time_usec = null
|
||
|
|
fingerprint = "7c4d2e4ade217c7b2cc583dc6445a0213083e00d38036e7937f840f214752681"
|
||
|
|
id = "users/tomy77690@gmail.com/sshPublicKeys/7c4d2e4ade217c7b2cc583dc6445a0213083e00d38036e7937f840f214752681"
|
||
|
|
key = <<-EOT
|
||
|
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCwPzmLXscOTqTODhprQttku2ocz8N1QfzAdEOsytUspqevFvh7BP3XyHSUJgFEdk8/HId5buSrpqaxw+TcHfZsbXJLonx/v2M9BZXQ8PRaQJiLKCcn1QDkJh/eM7Rp456I0kaLuFyOUXXK50rbK8LaRAZ9+nUdpzRIjPR1hV8l6jaqD2FvEzrYWX4xCB3PKtkYu075HBFnMriIuiVvqv8l+v7Qh2ImhDuoL0yE8CQra5Ctt8UiK/pQeTQ0sciZ38kl2Fc+7s+2xUfdGsSfveLlCuBwGtXOfOx2awCv/ubvdia35GoQnPMtmS6BE6TIUB1Mue/ihfGLJcuZDbufIBChpLcIhmRCXz3LRh/8S7nre2SLkDMWjtH/h+NdnZqM+Wegpd5dqr3hqDwLlWGgxS5ZVhgLZcT0YJRiioxHQ88df95glguLAngU8/j1BTtx/pexibNzk832s02AfU6oH/GrUFvWKvE8AxhZ60G1YkDZL5QhCPREIG3Jr/aaOtn35C0= tomy77690_gmail_com
|
||
|
|
EOT
|
||
|
|
project = "projet1-478713"
|
||
|
|
user = "tomy77690@gmail.com"
|
||
|
|
}
|
||
|
|
|
||
|
|
# module.iam.google_project_iam_binding.terraform_viewer:
|
||
|
|
resource "google_project_iam_binding" "terraform_viewer" {
|
||
|
|
etag = "BwZFHLSIFKA="
|
||
|
|
id = "projet1-478713/roles/viewer"
|
||
|
|
members = [
|
||
|
|
"serviceAccount:terraform@projet1-478713.iam.gserviceaccount.com",
|
||
|
|
]
|
||
|
|
project = "projet1-478713"
|
||
|
|
role = "roles/viewer"
|
||
|
|
}
|
||
|
|
|
||
|
|
# module.iam.google_service_account.terraform_sa:
|
||
|
|
resource "google_service_account" "terraform_sa" {
|
||
|
|
account_id = "terraform"
|
||
|
|
description = null
|
||
|
|
disabled = false
|
||
|
|
display_name = "Terraform Automation Service Account"
|
||
|
|
email = "terraform@projet1-478713.iam.gserviceaccount.com"
|
||
|
|
id = "projects/projet1-478713/serviceAccounts/terraform@projet1-478713.iam.gserviceaccount.com"
|
||
|
|
member = "serviceAccount:terraform@projet1-478713.iam.gserviceaccount.com"
|
||
|
|
name = "projects/projet1-478713/serviceAccounts/terraform@projet1-478713.iam.gserviceaccount.com"
|
||
|
|
project = "projet1-478713"
|
||
|
|
unique_id = "115574508184495432723"
|
||
|
|
}
|
||
|
|
|
||
|
|
# module.iam.google_service_account_key.terraform_sa_key:
|
||
|
|
resource "google_service_account_key" "terraform_sa_key" {
|
||
|
|
id = "projects/projet1-478713/serviceAccounts/terraform@projet1-478713.iam.gserviceaccount.com/keys/865ebed025dd906f92616ecb9197226bbd2d2f53"
|
||
|
|
key_algorithm = "KEY_ALG_RSA_2048"
|
||
|
|
name = "projects/projet1-478713/serviceAccounts/terraform@projet1-478713.iam.gserviceaccount.com/keys/865ebed025dd906f92616ecb9197226bbd2d2f53"
|
||
|
|
private_key = (sensitive value)
|
||
|
|
private_key_type = "TYPE_GOOGLE_CREDENTIALS_FILE"
|
||
|
|
public_key = "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUMvRENDQWVTZ0F3SUJBZ0lJT0tkWmlWZjJZU2N3RFFZSktvWklodmNOQVFFRkJRQXdJREVlTUJ3R0ExVUUKQXd3Vk1URTFOVGMwTlRBNE1UZzBORGsxTkRNeU56SXpNQ0FYRFRJMU1USXdOREE1TVRBME5sb1lEems1T1RreApNak14TWpNMU9UVTVXakFnTVI0d0hBWURWUVFEREJVeE1UVTFOelExTURneE9EUTBPVFUwTXpJM01qTXdnZ0VpCk1BMEdDU3FHU0liM0RRRUJBUVVBQTRJQkR3QXdnZ0VLQW9JQkFRQ2cwMjFBc2luZFIxWDU2ZmhJblZwZnIyZWQKaHRNOGlDSEhwWEx2SWpvcVBBcHZmZXhGUSsrMlQrUDdQTGNNdWEzVFlSMS81WmNWdEIxcFlMWUJkVWQ2REY0Qgp2bmtBdFJJRkhRMjRuTU1WeXVPN0Vvc2gvSE5lR3JwSW82aUJvd2ozL0I0eGVJeXRIeGtGcHBaSDdWbUM1OHRSCkdmRTBqWVZJK3I2dThEeVF1Y2U2R3FXL3Rtai9pTThDYzA4aTBNNk1RY1NGamlvR3N2cmtBYTlmNUdXencvbkwKTGp1QjY5YW1pWm9GNDlxT08wSXQwOURTTThVQWszTXNtS0o1RDJ4TkxaRnNQOFR1RGpQTTVLRlVLdUp1bmpZUwo5dTRFQ1A2SlpybUYzSzk1UUc4b3BwazhtMW5zLzdWcjMxM1FGT1BySmZjL0cyZUhMVE84STFrSWVaUWxBZ01CCkFBR2pPREEyTUF3R0ExVWRFd0VCL3dRQ01BQXdEZ1lEVlIwUEFRSC9CQVFEQWdlQU1CWUdBMVVkSlFFQi93UU0KTUFvR0NDc0dBUVVGQndNQ01BMEdDU3FHU0liM0RRRUJCUVVBQTRJQkFRQi81bWtRSlcvQWdPc1pGRUxWaFF3TQp0ZitKa3lvbFUzWE9PMUdiVlk4ODltZUR6VTdDREl4c2JQWGMzVE1ESlVxMmdUdEplNnpWTWdkc0JmTU9kWWhGCnFYUGxGemVSazlWWS9UTjQxOGV0bHYrN0lhSEIrbitKSFZMdUlHdERCWkI4dGtDS2lYVjBudnN6emV5eE5OZDgKMXJ2M3ZTdXIxbFJNWjN0SGdyR3RGVlAxOFYvanZGV01Oc1lyckdQbDlPbmVSbmJwU3BoNDQvcnBJbTVnWVE4Kwo2Q1dubkU1TXpwdnk2TW5Fb3c3WFAzLzVQZ1dvN1lZdlpad0ZPM3RZUGhzVlJSOFNEUXJ1OEtLazZ6SG1vV0x1CmE4NVVUNEpVUWc3Tkp5MURIeTQyVE5IdTMzNlAxVVlReGxKSzRrTDlJeDA3NUpYbEptWldjOU1ocEthd2RZcWcKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo="
|
||
|
|
public_key_type = "TYPE_X509_PEM_FILE"
|
||
|
|
service_account_id = "projects/projet1-478713/serviceAccounts/terraform@projet1-478713.iam.gserviceaccount.com"
|
||
|
|
valid_after = "2025-12-04T09:10:46Z"
|
||
|
|
valid_before = "9999-12-31T23:59:59Z"
|
||
|
|
}
|
||
|
|
# module.network.google_compute_firewall.allow_backend_database:
|
||
|
|
resource "google_compute_firewall" "allow_backend_database" {
|
||
|
|
creation_timestamp = "2025-12-03T08:17:36.423-08:00"
|
||
|
|
description = null
|
||
|
|
destination_ranges = []
|
||
|
|
direction = "INGRESS"
|
||
|
|
disabled = false
|
||
|
|
id = "projects/projet1-478713/global/firewalls/allow-backend-database"
|
||
|
|
name = "allow-backend-database"
|
||
|
|
network = "https://www.googleapis.com/compute/v1/projects/projet1-478713/global/networks/vpc-terraform"
|
||
|
|
priority = 1000
|
||
|
|
project = "projet1-478713"
|
||
|
|
self_link = "https://www.googleapis.com/compute/v1/projects/projet1-478713/global/firewalls/allow-backend-database"
|
||
|
|
source_ranges = []
|
||
|
|
source_service_accounts = []
|
||
|
|
source_tags = [
|
||
|
|
"backend",
|
||
|
|
]
|
||
|
|
target_service_accounts = []
|
||
|
|
target_tags = [
|
||
|
|
"database",
|
||
|
|
]
|
||
|
|
|
||
|
|
allow {
|
||
|
|
ports = [
|
||
|
|
"3306",
|
||
|
|
]
|
||
|
|
protocol = "tcp"
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
# module.network.google_compute_firewall.allow_frontend_backend:
|
||
|
|
resource "google_compute_firewall" "allow_frontend_backend" {
|
||
|
|
creation_timestamp = "2025-12-03T08:17:36.493-08:00"
|
||
|
|
description = null
|
||
|
|
destination_ranges = []
|
||
|
|
direction = "INGRESS"
|
||
|
|
disabled = false
|
||
|
|
id = "projects/projet1-478713/global/firewalls/allow-frontend-backend"
|
||
|
|
name = "allow-frontend-backend"
|
||
|
|
network = "https://www.googleapis.com/compute/v1/projects/projet1-478713/global/networks/vpc-terraform"
|
||
|
|
priority = 1000
|
||
|
|
project = "projet1-478713"
|
||
|
|
self_link = "https://www.googleapis.com/compute/v1/projects/projet1-478713/global/firewalls/allow-frontend-backend"
|
||
|
|
source_ranges = []
|
||
|
|
source_service_accounts = []
|
||
|
|
source_tags = [
|
||
|
|
"frontend",
|
||
|
|
]
|
||
|
|
target_service_accounts = []
|
||
|
|
target_tags = [
|
||
|
|
"backend",
|
||
|
|
]
|
||
|
|
|
||
|
|
allow {
|
||
|
|
ports = [
|
||
|
|
"8000",
|
||
|
|
]
|
||
|
|
protocol = "tcp"
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
# module.network.google_compute_firewall.allow_ssh_all:
|
||
|
|
resource "google_compute_firewall" "allow_ssh_all" {
|
||
|
|
creation_timestamp = "2025-12-03T08:17:36.051-08:00"
|
||
|
|
description = null
|
||
|
|
destination_ranges = []
|
||
|
|
direction = "INGRESS"
|
||
|
|
disabled = false
|
||
|
|
id = "projects/projet1-478713/global/firewalls/allow-ssh-all"
|
||
|
|
name = "allow-ssh-all"
|
||
|
|
network = "https://www.googleapis.com/compute/v1/projects/projet1-478713/global/networks/vpc-terraform"
|
||
|
|
priority = 1000
|
||
|
|
project = "projet1-478713"
|
||
|
|
self_link = "https://www.googleapis.com/compute/v1/projects/projet1-478713/global/firewalls/allow-ssh-all"
|
||
|
|
source_ranges = [
|
||
|
|
"0.0.0.0/0",
|
||
|
|
]
|
||
|
|
source_service_accounts = []
|
||
|
|
source_tags = []
|
||
|
|
target_service_accounts = []
|
||
|
|
target_tags = [
|
||
|
|
"ssh",
|
||
|
|
]
|
||
|
|
|
||
|
|
allow {
|
||
|
|
ports = [
|
||
|
|
"22",
|
||
|
|
]
|
||
|
|
protocol = "tcp"
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
# module.network.google_compute_firewall.allow_user_frontend:
|
||
|
|
resource "google_compute_firewall" "allow_user_frontend" {
|
||
|
|
creation_timestamp = "2025-12-03T08:17:36.468-08:00"
|
||
|
|
description = null
|
||
|
|
destination_ranges = []
|
||
|
|
direction = "INGRESS"
|
||
|
|
disabled = false
|
||
|
|
id = "projects/projet1-478713/global/firewalls/allow-user-frontend"
|
||
|
|
name = "allow-user-frontend"
|
||
|
|
network = "https://www.googleapis.com/compute/v1/projects/projet1-478713/global/networks/vpc-terraform"
|
||
|
|
priority = 1000
|
||
|
|
project = "projet1-478713"
|
||
|
|
self_link = "https://www.googleapis.com/compute/v1/projects/projet1-478713/global/firewalls/allow-user-frontend"
|
||
|
|
source_ranges = [
|
||
|
|
"0.0.0.0/0",
|
||
|
|
]
|
||
|
|
source_service_accounts = []
|
||
|
|
source_tags = []
|
||
|
|
target_service_accounts = []
|
||
|
|
target_tags = [
|
||
|
|
"frontend",
|
||
|
|
]
|
||
|
|
|
||
|
|
allow {
|
||
|
|
ports = [
|
||
|
|
"80",
|
||
|
|
"443",
|
||
|
|
]
|
||
|
|
protocol = "tcp"
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
# module.network.google_compute_network.vpc_terraform:
|
||
|
|
resource "google_compute_network" "vpc_terraform" {
|
||
|
|
auto_create_subnetworks = false
|
||
|
|
delete_default_routes_on_create = false
|
||
|
|
description = null
|
||
|
|
enable_ula_internal_ipv6 = false
|
||
|
|
gateway_ipv4 = null
|
||
|
|
id = "projects/projet1-478713/global/networks/vpc-terraform"
|
||
|
|
internal_ipv6_range = null
|
||
|
|
mtu = 0
|
||
|
|
name = "vpc-terraform"
|
||
|
|
network_firewall_policy_enforcement_order = "AFTER_CLASSIC_FIREWALL"
|
||
|
|
numeric_id = "746455655448960101"
|
||
|
|
project = "projet1-478713"
|
||
|
|
routing_mode = "REGIONAL"
|
||
|
|
self_link = "https://www.googleapis.com/compute/v1/projects/projet1-478713/global/networks/vpc-terraform"
|
||
|
|
}
|
||
|
|
|
||
|
|
# module.network.google_compute_subnetwork.subnet_backend:
|
||
|
|
resource "google_compute_subnetwork" "subnet_backend" {
|
||
|
|
creation_timestamp = "2025-12-03T08:17:36.342-08:00"
|
||
|
|
description = null
|
||
|
|
external_ipv6_prefix = null
|
||
|
|
gateway_address = "10.0.2.1"
|
||
|
|
id = "projects/projet1-478713/regions/europe-west2/subnetworks/backend"
|
||
|
|
internal_ipv6_prefix = null
|
||
|
|
ip_cidr_range = "10.0.2.0/24"
|
||
|
|
ipv6_access_type = null
|
||
|
|
ipv6_cidr_range = null
|
||
|
|
name = "backend"
|
||
|
|
network = "https://www.googleapis.com/compute/v1/projects/projet1-478713/global/networks/vpc-terraform"
|
||
|
|
private_ip_google_access = false
|
||
|
|
private_ipv6_google_access = "DISABLE_GOOGLE_ACCESS"
|
||
|
|
project = "projet1-478713"
|
||
|
|
purpose = "PRIVATE"
|
||
|
|
region = "europe-west2"
|
||
|
|
reserved_internal_range = null
|
||
|
|
role = null
|
||
|
|
self_link = "https://www.googleapis.com/compute/v1/projects/projet1-478713/regions/europe-west2/subnetworks/backend"
|
||
|
|
stack_type = "IPV4_ONLY"
|
||
|
|
}
|
||
|
|
|
||
|
|
# module.network.google_compute_subnetwork.subnet_database:
|
||
|
|
resource "google_compute_subnetwork" "subnet_database" {
|
||
|
|
creation_timestamp = "2025-12-03T08:17:37.219-08:00"
|
||
|
|
description = null
|
||
|
|
external_ipv6_prefix = null
|
||
|
|
gateway_address = "10.0.3.1"
|
||
|
|
id = "projects/projet1-478713/regions/europe-west2/subnetworks/database"
|
||
|
|
internal_ipv6_prefix = null
|
||
|
|
ip_cidr_range = "10.0.3.0/24"
|
||
|
|
ipv6_access_type = null
|
||
|
|
ipv6_cidr_range = null
|
||
|
|
name = "database"
|
||
|
|
network = "https://www.googleapis.com/compute/v1/projects/projet1-478713/global/networks/vpc-terraform"
|
||
|
|
private_ip_google_access = false
|
||
|
|
private_ipv6_google_access = "DISABLE_GOOGLE_ACCESS"
|
||
|
|
project = "projet1-478713"
|
||
|
|
purpose = "PRIVATE"
|
||
|
|
region = "europe-west2"
|
||
|
|
reserved_internal_range = null
|
||
|
|
role = null
|
||
|
|
self_link = "https://www.googleapis.com/compute/v1/projects/projet1-478713/regions/europe-west2/subnetworks/database"
|
||
|
|
stack_type = "IPV4_ONLY"
|
||
|
|
}
|
||
|
|
|
||
|
|
# module.network.google_compute_subnetwork.subnet_frontend:
|
||
|
|
resource "google_compute_subnetwork" "subnet_frontend" {
|
||
|
|
creation_timestamp = "2025-12-03T08:17:36.426-08:00"
|
||
|
|
description = null
|
||
|
|
external_ipv6_prefix = null
|
||
|
|
gateway_address = "10.0.1.1"
|
||
|
|
id = "projects/projet1-478713/regions/europe-west2/subnetworks/frontend"
|
||
|
|
internal_ipv6_prefix = null
|
||
|
|
ip_cidr_range = "10.0.1.0/24"
|
||
|
|
ipv6_access_type = null
|
||
|
|
ipv6_cidr_range = null
|
||
|
|
name = "frontend"
|
||
|
|
network = "https://www.googleapis.com/compute/v1/projects/projet1-478713/global/networks/vpc-terraform"
|
||
|
|
private_ip_google_access = false
|
||
|
|
private_ipv6_google_access = "DISABLE_GOOGLE_ACCESS"
|
||
|
|
project = "projet1-478713"
|
||
|
|
purpose = "PRIVATE"
|
||
|
|
region = "europe-west2"
|
||
|
|
reserved_internal_range = null
|
||
|
|
role = null
|
||
|
|
self_link = "https://www.googleapis.com/compute/v1/projects/projet1-478713/regions/europe-west2/subnetworks/frontend"
|
||
|
|
stack_type = "IPV4_ONLY"
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
Outputs:
|
||
|
|
|
||
|
|
compute_frontend_public_ip = "35.246.11.135"
|
||
|
|
compute_instance_names = [
|
||
|
|
"frontend-instance",
|
||
|
|
"backend-instance",
|
||
|
|
"database-instance",
|
||
|
|
]
|
||
|
|
compute_private_ips = {
|
||
|
|
backend = "10.0.2.2"
|
||
|
|
database = "10.0.3.2"
|
||
|
|
frontend = "10.0.1.2"
|
||
|
|
}
|
||
|
|
iam_service_account_email = "terraform@projet1-478713.iam.gserviceaccount.com"
|
||
|
|
iam_service_account_key = (sensitive value)
|
||
|
|
network_subnets = {
|
||
|
|
backend = "projects/projet1-478713/regions/europe-west2/subnetworks/backend"
|
||
|
|
database = "projects/projet1-478713/regions/europe-west2/subnetworks/database"
|
||
|
|
frontend = "projects/projet1-478713/regions/europe-west2/subnetworks/frontend"
|
||
|
|
}
|
||
|
|
network_vpc_id = "projects/projet1-478713/global/networks/vpc-terraform"
|