diff --git a/infrastructure-as-code/terraform/apps/app1/README.md b/infrastructure-as-code/terraform/apps/app1/README.md new file mode 100644 index 0000000..d2dd586 --- /dev/null +++ b/infrastructure-as-code/terraform/apps/app1/README.md @@ -0,0 +1,3 @@ +## Architecture +#### this is simple gce architecture. +![architecture](gcp_arche1.drawio.png) \ No newline at end of file diff --git a/infrastructure-as-code/terraform/apps/app1/create-compute-engine/compute.tf b/infrastructure-as-code/terraform/apps/app1/create-compute-engine/compute.tf new file mode 100644 index 0000000..5466f00 --- /dev/null +++ b/infrastructure-as-code/terraform/apps/app1/create-compute-engine/compute.tf @@ -0,0 +1,22 @@ +resource "google_compute_instance" "instance1" { + name = "instance1" + machine_type = "e2-micro" + zone = "asia-northeast1-a" + + boot_disk { + initialize_params { + image = "debian-cloud/debian-11" + labels = { + my_label = "value" + } + } + } + + network_interface { + network = google_compute_network.vpc1.name + subnetwork = google_compute_subnetwork.subnet1.name + network_ip = "10.2.0.2" + access_config { + } + } +} \ No newline at end of file diff --git a/infrastructure-as-code/terraform/apps/app1/create-compute-engine/gcp.tfvars b/infrastructure-as-code/terraform/apps/app1/create-compute-engine/gcp.tfvars new file mode 100644 index 0000000..19c5e0b --- /dev/null +++ b/infrastructure-as-code/terraform/apps/app1/create-compute-engine/gcp.tfvars @@ -0,0 +1,2 @@ +PROJECT_ID = "" +REGION = "asia-northeast1" \ No newline at end of file diff --git a/infrastructure-as-code/terraform/apps/app1/create-compute-engine/network.tf b/infrastructure-as-code/terraform/apps/app1/create-compute-engine/network.tf new file mode 100644 index 0000000..0b605c7 --- /dev/null +++ b/infrastructure-as-code/terraform/apps/app1/create-compute-engine/network.tf @@ -0,0 +1,11 @@ +resource "google_compute_network" "vpc1" { + name = "vpc1" + auto_create_subnetworks = "false" +} + +resource "google_compute_subnetwork" "subnet1" { + name = "subnet1" + ip_cidr_range = "10.2.0.0/16" + region = var.REGION + network = google_compute_network.vpc1.id +} diff --git a/infrastructure-as-code/terraform/apps/app1/create-compute-engine/provider.tf b/infrastructure-as-code/terraform/apps/app1/create-compute-engine/provider.tf new file mode 100644 index 0000000..5511d7c --- /dev/null +++ b/infrastructure-as-code/terraform/apps/app1/create-compute-engine/provider.tf @@ -0,0 +1,13 @@ +terraform { + required_providers { + google = { + source = "hashicorp/google" + version = "5.34.0" + } + } +} + +provider "google" { + project = var.PROJECT_ID + region = var.REGION +} \ No newline at end of file diff --git a/infrastructure-as-code/terraform/apps/app1/create-compute-engine/variables.tf b/infrastructure-as-code/terraform/apps/app1/create-compute-engine/variables.tf new file mode 100644 index 0000000..2b34810 --- /dev/null +++ b/infrastructure-as-code/terraform/apps/app1/create-compute-engine/variables.tf @@ -0,0 +1,7 @@ +variable "PROJECT_ID" { + type = string +} + +variable "REGION" { + type = string +} \ No newline at end of file diff --git a/infrastructure-as-code/terraform/apps/app1/gcp_arche1.drawio b/infrastructure-as-code/terraform/apps/app1/gcp_arche1.drawio new file mode 100644 index 0000000..391f24b --- /dev/null +++ b/infrastructure-as-code/terraform/apps/app1/gcp_arche1.drawio @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/infrastructure-as-code/terraform/apps/app1/gcp_arche1.drawio.png b/infrastructure-as-code/terraform/apps/app1/gcp_arche1.drawio.png new file mode 100644 index 0000000..8ba0834 Binary files /dev/null and b/infrastructure-as-code/terraform/apps/app1/gcp_arche1.drawio.png differ