테라폼 설정파일테스트

This commit is contained in:
Seong-dong 2022-12-28 14:24:56 +09:00
parent 72fb5351b6
commit 51d2505a1f
7 changed files with 26 additions and 5 deletions

1
.gitignore vendored
View File

@ -27,3 +27,4 @@ override.tf.json
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*
**/.teraformmrc

View File

@ -6,7 +6,7 @@ resource "aws_subnet" "subnets" {
availability_zone = each.value.name
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 = {
Name = var.vpc_name

1
prod-hq/.terraformrc Normal file
View File

@ -0,0 +1 @@
test

View File

@ -1,5 +1,15 @@
// prod - main
terraform {
backend "remote"{
hostname = "app.terraform.io"
organization = "22shop"
workspaces {
name = "tf-cloud-backend"
}
}
}
provider "aws" {
region = "ap-northeast-2"
@ -8,19 +18,28 @@ provider "aws" {
}
locals {
common_tags = {
project = "22shop"
owner = "icurfer"
}
}
# module "vpc_hq" {
module "vpc_hq" {
source = "../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"
}
module "vpc_igw" {
source = "../modules/igw"
tag_name = var.prod_name
vpc_id = module.vpc_hq.vpc_hq_id
tag_name = "${local.common_tags.project}-vpc_igw"
}
module "subnet_public" {
@ -29,13 +48,13 @@ module "subnet_public" {
vpc_id = module.vpc_hq.vpc_hq_id
subnet-az-list = var.subnet-az-list
public_ip_on = true
vpc_name = "${module.vpc_hq.vpc_name}-public"
vpc_name = "${local.common_tags.project}-public"
}
// public route
module "route_public" {
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
}