From a0d22896a0cffa967a77eb3a97439f11e4d2fde8 Mon Sep 17 00:00:00 2001 From: Seong-dong Date: Mon, 26 Dec 2022 11:33:19 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B8=B0=EC=A1=B4=20=EB=A1=9C=EC=BB=AC=20?= =?UTF-8?q?=EC=9E=90=EB=A3=8C=20=EB=B3=B5=EC=82=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/main.tf | 0 modules/outputs.tf | 0 modules/valiables.tf | 0 modules/vpc-subnet/main.tf | 0 modules/vpc/main.tf | 9 ++++++++ modules/vpc/outputs.tf | 5 +++++ modules/vpc/valiables.tf | 29 +++++++++++++++++++++++++ nm-ecr/.terraform.lock.hcl | 39 ++++++++++++++++++++++++++++++++++ nm-ecr/main.tf | 42 +++++++++++++++++++++++++++++++++++++ nm-eks/.terraform.lock.hcl | 20 ++++++++++++++++++ nm-eks/main.tf | 0 prod/.terraform.lock.hcl | 20 ++++++++++++++++++ prod/main.tf | 39 ++++++++++++++++++++++++++++++++++ prod/outputs.tf | 6 ++++++ prod/valiables.tf | 5 +++++ 테라폼구성도.xlsx | Bin 0 -> 9783 bytes 16 files changed, 214 insertions(+) create mode 100644 modules/main.tf create mode 100644 modules/outputs.tf create mode 100644 modules/valiables.tf create mode 100644 modules/vpc-subnet/main.tf create mode 100644 modules/vpc/main.tf create mode 100644 modules/vpc/outputs.tf create mode 100644 modules/vpc/valiables.tf create mode 100644 nm-ecr/.terraform.lock.hcl create mode 100644 nm-ecr/main.tf create mode 100644 nm-eks/.terraform.lock.hcl create mode 100644 nm-eks/main.tf create mode 100644 prod/.terraform.lock.hcl create mode 100644 prod/main.tf create mode 100644 prod/outputs.tf create mode 100644 prod/valiables.tf create mode 100644 테라폼구성도.xlsx diff --git a/modules/main.tf b/modules/main.tf new file mode 100644 index 0000000..e69de29 diff --git a/modules/outputs.tf b/modules/outputs.tf new file mode 100644 index 0000000..e69de29 diff --git a/modules/valiables.tf b/modules/valiables.tf new file mode 100644 index 0000000..e69de29 diff --git a/modules/vpc-subnet/main.tf b/modules/vpc-subnet/main.tf new file mode 100644 index 0000000..e69de29 diff --git a/modules/vpc/main.tf b/modules/vpc/main.tf new file mode 100644 index 0000000..4285b96 --- /dev/null +++ b/modules/vpc/main.tf @@ -0,0 +1,9 @@ +resource "aws_vpc" "vpcHq" { + # cidr_block = "10.3.0.0/16" + cidr_block = var.cidr_block + // instance_tenancy = "default" + + tags = { + Name = "test" + } +} \ No newline at end of file diff --git a/modules/vpc/outputs.tf b/modules/vpc/outputs.tf new file mode 100644 index 0000000..beaae64 --- /dev/null +++ b/modules/vpc/outputs.tf @@ -0,0 +1,5 @@ +//modules-vpc-output +output "vpc_hq_id" { + description = "The name of vpc hq id" + value = aws_vpc.vpcHq.id +} \ No newline at end of file diff --git a/modules/vpc/valiables.tf b/modules/vpc/valiables.tf new file mode 100644 index 0000000..d5567c0 --- /dev/null +++ b/modules/vpc/valiables.tf @@ -0,0 +1,29 @@ +variable "cidr_block" { + description = "value" + type = string +} + +// reference | https://github.com/davidcsi/terraform/blob/master/healthchecks/main.tf +variable "subnet-az-list" { + description = "Subnet available zone & cidr" + type = map(map(string)) + default = { + "zone-a" = { + name = "ap-northeast-2a" + cidr = "10.3.1.0/24" + } + "zone-b" = { + name = "ap-northeast-2b" + cidr = "10.3.2.0/24" + } + "zone-c" = { + name = "ap-northeast-2c" + cidr = "10.3.3.0/24" + } + "zone-d" = { + name = "ap-northeast-2d" + cidr = "10.3.4.0/24" + } + } + +} \ No newline at end of file diff --git a/nm-ecr/.terraform.lock.hcl b/nm-ecr/.terraform.lock.hcl new file mode 100644 index 0000000..f94b4fd --- /dev/null +++ b/nm-ecr/.terraform.lock.hcl @@ -0,0 +1,39 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/aws" { + version = "2.70.1" + constraints = "~> 2.0" + hashes = [ + "h1:SQR8egOmFbwBHOSMzUYg/Mt4e0LsQe91ma9I2Ug3lmY=", + "zh:04137cdf128cf21dcd190bbba4d4bba43c7868c52ad646b0eaa54a8b8b8160a7", + "zh:30c9f956133a102b4a426d76dd3ef1a42332d9875261a06aa877409aa6b2b556", + "zh:3107a43647454a3d6d847fba6aa593650af0f6a353272c04450408af5f4d353a", + "zh:3f17285478313af822447b453fa4e37f30ef221f0b0e8f2e4655f1ac9f9de1a2", + "zh:5a626f7a3c4a9fea3bdfde63aedbf6eea73760f3b228f776f1132b61d00c7ff2", + "zh:6aafc9dd79b511b9e3d0ec49f7df1d1fd697c3c873d1d70a2be1a12475b50206", + "zh:6fb29b48ccc85f7e9dfde3867ce99d6d65fb76bea68c97d404fae431758a8f03", + "zh:c47be92e1edf2e8675c932030863536c1a79decf85b2baa4232e5936c5f7088f", + "zh:cd0a4b28c5e4b5092043803d17fd1d495ecb926c2688603c4cdab4c20f3a91f4", + "zh:fb0ff763cb5d7a696989e58e0e4b88b1faed2a62b9fb83f4f7c2400ad6fabb84", + ] +} + +provider "registry.terraform.io/hashicorp/null" { + version = "3.2.1" + hashes = [ + "h1:vUW21lLLsKlxtBf0QF7LKJreKxs0CM7YXGzqW1N/ODY=", + "zh:58ed64389620cc7b82f01332e27723856422820cfd302e304b5f6c3436fb9840", + "zh:62a5cc82c3b2ddef7ef3a6f2fedb7b9b3deff4ab7b414938b08e51d6e8be87cb", + "zh:63cff4de03af983175a7e37e52d4bd89d990be256b16b5c7f919aff5ad485aa5", + "zh:74cb22c6700e48486b7cabefa10b33b801dfcab56f1a6ac9b6624531f3d36ea3", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:79e553aff77f1cfa9012a2218b8238dd672ea5e1b2924775ac9ac24d2a75c238", + "zh:a1e06ddda0b5ac48f7e7c7d59e1ab5a4073bbcf876c73c0299e4610ed53859dc", + "zh:c37a97090f1a82222925d45d84483b2aa702ef7ab66532af6cbcfb567818b970", + "zh:e4453fbebf90c53ca3323a92e7ca0f9961427d2f0ce0d2b65523cc04d5d999c2", + "zh:e80a746921946d8b6761e77305b752ad188da60688cfd2059322875d363be5f5", + "zh:fbdb892d9822ed0e4cb60f2fedbdbb556e4da0d88d3b942ae963ed6ff091e48f", + "zh:fca01a623d90d0cad0843102f9b8b9fe0d3ff8244593bd817f126582b52dd694", + ] +} diff --git a/nm-ecr/main.tf b/nm-ecr/main.tf new file mode 100644 index 0000000..e608eb3 --- /dev/null +++ b/nm-ecr/main.tf @@ -0,0 +1,42 @@ +//ecr make +provider "aws" { + region = "ap-northeast-2" + + #2.x버전의 AWS공급자 허용 + version = "~> 2.0" + +} + +resource "aws_ecr_repository" "foo" { + name = "demo-flask-backend" + image_tag_mutability = "MUTABLE" + image_scanning_configuration { + scan_on_push = true + } +} + +resource "aws_ecr_repository" "bar" { + name = "demo-frontend" + image_tag_mutability = "MUTABLE" + image_scanning_configuration { + scan_on_push = true + } +} +# resource "null_resource" "null_for_ecr_get_login_password" { +# provisioner "local-exec" { +# command = <y-7N$Q5ZobHkl=2?-2yZaGz51G5F`+s27 z(HA8wWe`1YZuLzzQtMOeC!$O0En(0eUqu16gc z++Bx~ua(Q&JKwe}ufBxI^CNE@V{H_B!tyT1O=ycl;AaiZ+|T7Wh|2Rq&-1mqzgW??xa+uoYN3q?J6F7| z=fbtnXVgx8<3sK{HUm(!3ai8`VzU|c=oG@uln|bg-ZV9!cH@^UTmQu!B8dggOTuR z^1S~szsMiH+e?1A%261Gg~LZ#?NSsNfBV4+{?$wSIPnjKE1j6mlNXbh2@=w-w9ZYD zuL^2&K{9<{O7Za%u`-Ndrgub$*xyM4@dOflw7TUqmyE89p(aIC4vGRxYq-;QV}_Hw zrsJ}AP=$hdW%tJtaC;q$%x8<;d#%YYZiv)WEO_6S8l~F5rf}6av2HyROKQP>aA%ZH z?p3DXz`AA|mgu2Qzwpwk?r6x?(+>J%Uyyf)IUiwm`S|l00RItK%@*E zGBO{nnO$t{t&D7Kt$ylOp&HOOl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