테라폼 설정파일테스트
This commit is contained in:
parent
72fb5351b6
commit
51d2505a1f
1
.gitignore
vendored
1
.gitignore
vendored
@ -27,3 +27,4 @@ override.tf.json
|
|||||||
|
|
||||||
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
|
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
|
||||||
# example: *tfplan*
|
# example: *tfplan*
|
||||||
|
**/.teraformmrc
|
||||||
|
@ -6,7 +6,7 @@ resource "aws_subnet" "subnets" {
|
|||||||
availability_zone = each.value.name
|
availability_zone = each.value.name
|
||||||
cidr_block = each.value.cidr
|
cidr_block = each.value.cidr
|
||||||
|
|
||||||
map_public_ip_on_launch = var.public_ip_on
|
map_public_ip_on_launch = var.public_ip_on ? true : false
|
||||||
|
|
||||||
tags = {
|
tags = {
|
||||||
Name = var.vpc_name
|
Name = var.vpc_name
|
||||||
|
1
prod-hq/.terraformrc
Normal file
1
prod-hq/.terraformrc
Normal file
@ -0,0 +1 @@
|
|||||||
|
test
|
@ -1,5 +1,15 @@
|
|||||||
// prod - main
|
// prod - main
|
||||||
|
terraform {
|
||||||
|
backend "remote"{
|
||||||
|
hostname = "app.terraform.io"
|
||||||
|
organization = "22shop"
|
||||||
|
|
||||||
|
workspaces {
|
||||||
|
name = "tf-cloud-backend"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
provider "aws" {
|
provider "aws" {
|
||||||
region = "ap-northeast-2"
|
region = "ap-northeast-2"
|
||||||
|
|
||||||
@ -8,19 +18,28 @@ provider "aws" {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
locals {
|
||||||
|
common_tags = {
|
||||||
|
project = "22shop"
|
||||||
|
owner = "icurfer"
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
# module "vpc_hq" {
|
# module "vpc_hq" {
|
||||||
module "vpc_hq" {
|
module "vpc_hq" {
|
||||||
source = "../modules/vpc"
|
source = "../modules/vpc"
|
||||||
# source = "github.com/Seong-dong/team_prj/tree/main/modules/vpc"
|
# source = "github.com/Seong-dong/team_prj/tree/main/modules/vpc"
|
||||||
tag_name = var.prod_name
|
tag_name = "${local.common_tags.project}-vpc"
|
||||||
cidr_block = "10.3.0.0/16"
|
cidr_block = "10.3.0.0/16"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module "vpc_igw" {
|
module "vpc_igw" {
|
||||||
source = "../modules/igw"
|
source = "../modules/igw"
|
||||||
tag_name = var.prod_name
|
|
||||||
vpc_id = module.vpc_hq.vpc_hq_id
|
vpc_id = module.vpc_hq.vpc_hq_id
|
||||||
|
|
||||||
|
tag_name = "${local.common_tags.project}-vpc_igw"
|
||||||
}
|
}
|
||||||
|
|
||||||
module "subnet_public" {
|
module "subnet_public" {
|
||||||
@ -29,13 +48,13 @@ module "subnet_public" {
|
|||||||
vpc_id = module.vpc_hq.vpc_hq_id
|
vpc_id = module.vpc_hq.vpc_hq_id
|
||||||
subnet-az-list = var.subnet-az-list
|
subnet-az-list = var.subnet-az-list
|
||||||
public_ip_on = true
|
public_ip_on = true
|
||||||
vpc_name = "${module.vpc_hq.vpc_name}-public"
|
vpc_name = "${local.common_tags.project}-public"
|
||||||
}
|
}
|
||||||
|
|
||||||
// public route
|
// public route
|
||||||
module "route_public" {
|
module "route_public" {
|
||||||
source = "../modules/route-table"
|
source = "../modules/route-table"
|
||||||
tag_name = var.prod_name
|
tag_name = "${local.common_tags.project}-route_table"
|
||||||
vpc_id = module.vpc_hq.vpc_hq_id
|
vpc_id = module.vpc_hq.vpc_hq_id
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user