테라폼 환경 수정

This commit is contained in:
2022-12-31 17:52:18 +09:00
parent 2281b27e7a
commit 7f4d9b1104
34 changed files with 732 additions and 102 deletions

View File

@ -0,0 +1,5 @@
resource "aws_cloud9_environment_membership" "cloud9-env" {
environment_id = var.cloud9_id
permissions = var.permissions
user_arn = var.user_arn
}

View File

@ -0,0 +1,10 @@
variable "cloud9_id" {
description = "cloud9-ec2"
type = string
}
variable "permissions" {
type = string
}
variable "user_arn" {
type = string
}

View File

@ -0,0 +1,4 @@
resource "aws_cloud9_environment_ec2" "cloud9-dev" {
instance_type = var.instance_type
name = var.name
}

View File

@ -0,0 +1,3 @@
output "cloud9_id" {
value = aws_cloud9_environment_ec2.cloud9-dev.id
}

View File

@ -0,0 +1,6 @@
variable "instance_type" {
type = string
}
variable "name" {
type = string
}

0
modules/efs/main.tf Normal file
View File

0
modules/efs/outputs.tf Normal file
View File

0
modules/efs/variables.tf Normal file
View File

View File

@ -6,10 +6,25 @@ resource "aws_eks_cluster" "eks-cluster" {
vpc_config {
security_group_ids = var.sg_list
subnet_ids = var.subnet_list
subnet_ids = var.subnet_list
#노드그룹 통신을 위한 설정
endpoint_private_access = true
endpoint_public_access = true
}
}
# //신뢰할수있는 사용자 등록
# resource "aws_eks_identity_provider_config" "eks-cluster-oidc-provider" {
# cluster_name = aws_eks_cluster.eks-cluster.name
# oidc {
# client_id = var.client_id
# identity_provider_config_name = "eks-example"
# issuer_url = "${aws_eks_cluster.eks-cluster.identity[0].oidc[0].issuer}"
# }
# depends_on = [
# aws_eks_cluster.eks-cluster
# ]
# }

View File

@ -9,3 +9,7 @@ output "kubeconfig-certificate-authority-data" {
output "cluster_name" {
value = aws_eks_cluster.eks-cluster.name
}
output "cluster_oidc" {
value = "${aws_eks_cluster.eks-cluster.identity[0].oidc[0].issuer}"
}

View File

@ -12,3 +12,8 @@ variable "subnet_list" {
type = list(string)
}
variable "client_id" {
type = string
}

View File

@ -1,24 +0,0 @@
resource "aws_iam_role" "eks-cluster" {
name = "iam role eks-cluster"
# Terraform's "jsonencode" function converts a
# Terraform expression result to valid JSON syntax.
assume_role_policy = jsonencode({
"Version" : "2012-10-17",
"Statement" : [
{
"Effect" : "Allow",
"Principal" : {
"Service" : [
"eks.amazonaws.com"
]
},
"Action" : "sts:AssumeRole"
}
]
})
tags = {
tag-key = "eks-cluster-rule"
}
}

View File

@ -10,6 +10,7 @@ resource "aws_subnet" "subnets" {
tags = {
Name = var.vpc_name
"kubernetes.io/role/elb" = 1
# Name = module.vpc_hq.vpcHq.id
}
}

View File

@ -1,10 +0,0 @@
terraform {
backend "remote"{
hostname = "app.terraform.io"
organization = "22shop"
workspaces {
name = "tf-cloud-backend"
}
}
}

View File

@ -7,7 +7,6 @@ variable "vpc_name" {
description = "set vpc name"
type = string
}
// reference | https://github.com/davidcsi/terraform/blob/master/healthchecks/main.tf
variable "subnet-az-list" {
description = "Subnet available zone & cidr"