cowork
This commit is contained in:
@ -1,15 +1,18 @@
|
||||
// prod - main
|
||||
provider "aws" {
|
||||
region = "ap-northeast-2"
|
||||
|
||||
#2.x버전의 AWS공급자 허용
|
||||
region = "ap-northeast-2"
|
||||
profile = "22shop"
|
||||
shared_credentials_file = "C:/Users/aa/.aws/credentials"
|
||||
#3.x버전의 AWS공급자 허용
|
||||
version = "~> 3.0"
|
||||
|
||||
}
|
||||
|
||||
locals {
|
||||
account_id = data.aws_caller_identity.this.account_id
|
||||
vpc_id = data.terraform_remote_state.hq_vpc_id.outputs.vpc_id
|
||||
public_subnet = data.terraform_remote_state.hq_vpc_id.outputs.subnet
|
||||
subnet = data.terraform_remote_state.hq_vpc_id.outputs.private_subnet
|
||||
# subnet = data.terraform_remote_state.hq_vpc_id.outputs.public_subnet
|
||||
common_tags = {
|
||||
project = "22shop"
|
||||
owner = "icurfer"
|
||||
@ -69,10 +72,10 @@ data "terraform_remote_state" "hq_vpc_id" {
|
||||
backend = "remote"
|
||||
|
||||
config = {
|
||||
organization = "icurfer"
|
||||
organization = "22shop"
|
||||
|
||||
workspaces = {
|
||||
name = "tf-cloud-network"
|
||||
name = "hq-network"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -107,6 +110,9 @@ module "eks_cluster_iam_att2" {
|
||||
]
|
||||
}
|
||||
|
||||
//ec2 Bastion Host
|
||||
|
||||
|
||||
// eks 노드그룹 역할 생성 및 추가
|
||||
module "eks_nodegroup_iam" {
|
||||
source = "../modules/iam"
|
||||
@ -145,7 +151,7 @@ module "eks_nodegroup_iam_att_3" {
|
||||
]
|
||||
}
|
||||
|
||||
// 보안그룹 생성
|
||||
// 보안그룹 생성(추가 보안그룹)
|
||||
module "eks_sg" {
|
||||
source = "../modules/sg"
|
||||
sg_name = "${local.common_tags.project}-sg"
|
||||
@ -185,7 +191,7 @@ module "eks_cluster" {
|
||||
iam_role_arn = module.eks_cluster_iam.iam_arn
|
||||
sg_list = [module.eks_sg.sg_id]
|
||||
# subnet_list = [module.subnet_public.subnet.zone-a.id, module.subnet_public.subnet.zone-c.id] #변경해야될수있음.
|
||||
subnet_list = [local.public_subnet.zone-a.id, local.public_subnet.zone-c.id]
|
||||
subnet_list = [local.subnet.zone-a.id, local.subnet.zone-c.id]
|
||||
|
||||
depends_on = [
|
||||
module.eks_cluster_iam,
|
||||
@ -201,9 +207,9 @@ module "eks_node_group" {
|
||||
node_group_name = "${local.common_tags.project}-ng"
|
||||
cluster_name = module.eks_cluster.cluster_name
|
||||
# iam_role_arn = module.eks_nodegroup_iam.iam_arn
|
||||
iam_role_arn = "arn:aws:iam::448559955338:role/eks-nodegroup-test"
|
||||
iam_role_arn = "arn:aws:iam::${local.account_id}:role/eks-nodegroup-test"
|
||||
# subnet_list = [module.subnet_public.subnet.zone-a.id, module.subnet_public.subnet.zone-c.id] #변경해야될수있음.
|
||||
subnet_list = [local.public_subnet.zone-a.id, local.public_subnet.zone-c.id]
|
||||
subnet_list = [local.subnet.zone-a.id, local.subnet.zone-c.id]
|
||||
|
||||
desired_size = local.node_group_scaling_config.desired_size
|
||||
max_size = local.node_group_scaling_config.max_size
|
||||
|
@ -1,10 +1,10 @@
|
||||
terraform {
|
||||
backend "remote"{
|
||||
hostname = "app.terraform.io"
|
||||
organization = "icurfer"
|
||||
organization = "22shop"
|
||||
|
||||
workspaces {
|
||||
name = "tf-cloud-eks"
|
||||
name = "hq-eks"
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user