테라폼 환경 수정
This commit is contained in:
5
modules/cloud9-ec2-env/main.tf
Normal file
5
modules/cloud9-ec2-env/main.tf
Normal 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
|
||||
}
|
10
modules/cloud9-ec2-env/variables.tf
Normal file
10
modules/cloud9-ec2-env/variables.tf
Normal file
@ -0,0 +1,10 @@
|
||||
variable "cloud9_id" {
|
||||
description = "cloud9-ec2"
|
||||
type = string
|
||||
}
|
||||
variable "permissions" {
|
||||
type = string
|
||||
}
|
||||
variable "user_arn" {
|
||||
type = string
|
||||
}
|
4
modules/cloud9-ec2/main.tf
Normal file
4
modules/cloud9-ec2/main.tf
Normal file
@ -0,0 +1,4 @@
|
||||
resource "aws_cloud9_environment_ec2" "cloud9-dev" {
|
||||
instance_type = var.instance_type
|
||||
name = var.name
|
||||
}
|
3
modules/cloud9-ec2/outputs.tf
Normal file
3
modules/cloud9-ec2/outputs.tf
Normal file
@ -0,0 +1,3 @@
|
||||
output "cloud9_id" {
|
||||
value = aws_cloud9_environment_ec2.cloud9-dev.id
|
||||
}
|
6
modules/cloud9-ec2/variables.tf
Normal file
6
modules/cloud9-ec2/variables.tf
Normal file
@ -0,0 +1,6 @@
|
||||
variable "instance_type" {
|
||||
type = string
|
||||
}
|
||||
variable "name" {
|
||||
type = string
|
||||
}
|
0
modules/efs/main.tf
Normal file
0
modules/efs/main.tf
Normal file
0
modules/efs/outputs.tf
Normal file
0
modules/efs/outputs.tf
Normal file
0
modules/efs/variables.tf
Normal file
0
modules/efs/variables.tf
Normal 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
|
||||
# ]
|
||||
# }
|
||||
|
@ -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}"
|
||||
}
|
@ -12,3 +12,8 @@ variable "subnet_list" {
|
||||
type = list(string)
|
||||
|
||||
}
|
||||
|
||||
variable "client_id" {
|
||||
type = string
|
||||
|
||||
}
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ resource "aws_subnet" "subnets" {
|
||||
|
||||
tags = {
|
||||
Name = var.vpc_name
|
||||
"kubernetes.io/role/elb" = 1
|
||||
# Name = module.vpc_hq.vpcHq.id
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
terraform {
|
||||
backend "remote"{
|
||||
hostname = "app.terraform.io"
|
||||
organization = "22shop"
|
||||
|
||||
workspaces {
|
||||
name = "tf-cloud-backend"
|
||||
}
|
||||
}
|
||||
}
|
@ -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"
|
||||
|
Reference in New Issue
Block a user