forked from pierront/but3-iac
1 bonus pas catégorie
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"version": 4,
|
"version": 4,
|
||||||
"terraform_version": "1.14.1",
|
"terraform_version": "1.14.1",
|
||||||
"serial": 54,
|
"serial": 58,
|
||||||
"lineage": "39fa9bd0-98c8-1759-7f73-ed127b902d8b",
|
"lineage": "39fa9bd0-98c8-1759-7f73-ed127b902d8b",
|
||||||
"outputs": {
|
"outputs": {
|
||||||
"frontend_public_ip": {
|
"frontend_public_ip": {
|
||||||
@@ -282,9 +282,11 @@
|
|||||||
"labels": {},
|
"labels": {},
|
||||||
"machine_type": "e2-small",
|
"machine_type": "e2-small",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"enable-oslogin": "TRUE"
|
"enable-oslogin": "TRUE",
|
||||||
|
"environment": "dev",
|
||||||
|
"owner": "clemence"
|
||||||
},
|
},
|
||||||
"metadata_fingerprint": "VIFIa5rN4V4=",
|
"metadata_fingerprint": "o5AWSB3O6Qs=",
|
||||||
"metadata_startup_script": null,
|
"metadata_startup_script": null,
|
||||||
"min_cpu_platform": "",
|
"min_cpu_platform": "",
|
||||||
"name": "database-instance",
|
"name": "database-instance",
|
||||||
@@ -609,6 +611,35 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"module": "module.iam",
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "google_project_iam_custom_role",
|
||||||
|
"name": "custom_viewer",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/google\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"deleted": false,
|
||||||
|
"description": "Role custom pour TP",
|
||||||
|
"id": "projects/western-diorama-374821/roles/customBasicViewer",
|
||||||
|
"name": "projects/western-diorama-374821/roles/customBasicViewer",
|
||||||
|
"permissions": [
|
||||||
|
"compute.instances.get",
|
||||||
|
"compute.instances.list"
|
||||||
|
],
|
||||||
|
"project": "western-diorama-374821",
|
||||||
|
"role_id": "customBasicViewer",
|
||||||
|
"stage": "GA",
|
||||||
|
"title": "Custom Basic Viewer"
|
||||||
|
},
|
||||||
|
"sensitive_attributes": [],
|
||||||
|
"identity_schema_version": 0,
|
||||||
|
"private": "bnVsbA=="
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"module": "module.iam",
|
"module": "module.iam",
|
||||||
"mode": "managed",
|
"mode": "managed",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"version": 4,
|
"version": 4,
|
||||||
"terraform_version": "1.14.1",
|
"terraform_version": "1.14.1",
|
||||||
"serial": 51,
|
"serial": 56,
|
||||||
"lineage": "39fa9bd0-98c8-1759-7f73-ed127b902d8b",
|
"lineage": "39fa9bd0-98c8-1759-7f73-ed127b902d8b",
|
||||||
"outputs": {
|
"outputs": {
|
||||||
"frontend_public_ip": {
|
"frontend_public_ip": {
|
||||||
@@ -282,9 +282,11 @@
|
|||||||
"labels": {},
|
"labels": {},
|
||||||
"machine_type": "e2-small",
|
"machine_type": "e2-small",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"enable-oslogin": "TRUE"
|
"enable-oslogin": "TRUE",
|
||||||
|
"environment": "dev",
|
||||||
|
"owner": "clemence"
|
||||||
},
|
},
|
||||||
"metadata_fingerprint": "VIFIa5rN4V4=",
|
"metadata_fingerprint": "o5AWSB3O6Qs=",
|
||||||
"metadata_startup_script": null,
|
"metadata_startup_script": null,
|
||||||
"min_cpu_platform": "",
|
"min_cpu_platform": "",
|
||||||
"name": "database-instance",
|
"name": "database-instance",
|
||||||
@@ -916,6 +918,90 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"module": "module.network",
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "google_compute_router",
|
||||||
|
"name": "nat_router",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/google\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"bgp": [],
|
||||||
|
"creation_timestamp": "2025-12-04T01:14:24.736-08:00",
|
||||||
|
"description": "",
|
||||||
|
"encrypted_interconnect_router": false,
|
||||||
|
"id": "projects/western-diorama-374821/regions/us-central1/routers/western-diorama-374821-nat-router",
|
||||||
|
"name": "western-diorama-374821-nat-router",
|
||||||
|
"network": "https://www.googleapis.com/compute/v1/projects/western-diorama-374821/global/networks/western-diorama-374821-vpc",
|
||||||
|
"project": "western-diorama-374821",
|
||||||
|
"region": "us-central1",
|
||||||
|
"self_link": "https://www.googleapis.com/compute/v1/projects/western-diorama-374821/regions/us-central1/routers/western-diorama-374821-nat-router",
|
||||||
|
"timeouts": null
|
||||||
|
},
|
||||||
|
"sensitive_attributes": [],
|
||||||
|
"identity_schema_version": 0,
|
||||||
|
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH19",
|
||||||
|
"dependencies": [
|
||||||
|
"module.network.google_compute_network.vpc"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.network",
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "google_compute_router_nat",
|
||||||
|
"name": "nat_config",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/google\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"auto_network_tier": "PREMIUM",
|
||||||
|
"drain_nat_ips": [],
|
||||||
|
"enable_dynamic_port_allocation": false,
|
||||||
|
"enable_endpoint_independent_mapping": false,
|
||||||
|
"endpoint_types": [
|
||||||
|
"ENDPOINT_TYPE_VM"
|
||||||
|
],
|
||||||
|
"icmp_idle_timeout_sec": 30,
|
||||||
|
"id": "western-diorama-374821/us-central1/western-diorama-374821-nat-router/western-diorama-374821-nat-config",
|
||||||
|
"initial_nat_ips": null,
|
||||||
|
"log_config": [
|
||||||
|
{
|
||||||
|
"enable": false,
|
||||||
|
"filter": "ALL"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"max_ports_per_vm": 0,
|
||||||
|
"min_ports_per_vm": 0,
|
||||||
|
"name": "western-diorama-374821-nat-config",
|
||||||
|
"nat_ip_allocate_option": "AUTO_ONLY",
|
||||||
|
"nat_ips": [],
|
||||||
|
"project": "western-diorama-374821",
|
||||||
|
"region": "us-central1",
|
||||||
|
"router": "western-diorama-374821-nat-router",
|
||||||
|
"rules": [],
|
||||||
|
"source_subnetwork_ip_ranges_to_nat": "ALL_SUBNETWORKS_ALL_IP_RANGES",
|
||||||
|
"subnetwork": [],
|
||||||
|
"tcp_established_idle_timeout_sec": 1200,
|
||||||
|
"tcp_time_wait_timeout_sec": 120,
|
||||||
|
"tcp_transitory_idle_timeout_sec": 30,
|
||||||
|
"timeouts": null,
|
||||||
|
"udp_idle_timeout_sec": 30
|
||||||
|
},
|
||||||
|
"sensitive_attributes": [],
|
||||||
|
"identity_schema_version": 0,
|
||||||
|
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH19",
|
||||||
|
"dependencies": [
|
||||||
|
"module.network.google_compute_network.vpc",
|
||||||
|
"module.network.google_compute_router.nat_router"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"module": "module.network",
|
"module": "module.network",
|
||||||
"mode": "managed",
|
"mode": "managed",
|
||||||
|
|||||||
@@ -76,5 +76,7 @@ resource "google_compute_instance" "database" {
|
|||||||
|
|
||||||
metadata = {
|
metadata = {
|
||||||
enable-oslogin = "TRUE"
|
enable-oslogin = "TRUE"
|
||||||
|
environment = "dev"
|
||||||
|
owner = "clemence"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,3 +28,14 @@ resource "google_os_login_ssh_public_key" "ssh_key" {
|
|||||||
key = file(pathexpand("~/.ssh/id_ed25519.pub"))
|
key = file(pathexpand("~/.ssh/id_ed25519.pub"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "google_project_iam_custom_role" "custom_viewer" {
|
||||||
|
role_id = "customBasicViewer"
|
||||||
|
title = "Custom Basic Viewer"
|
||||||
|
project = var.project_id
|
||||||
|
description = "Role custom pour TP"
|
||||||
|
|
||||||
|
permissions = [
|
||||||
|
"compute.instances.get",
|
||||||
|
"compute.instances.list",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user