sg, eks, iam 모듈추가

This commit is contained in:
2022-12-28 22:15:11 +09:00
parent 878bae5c65
commit 0b1946ecb3
25 changed files with 342 additions and 41 deletions

View File

@ -0,0 +1,14 @@
{
"Version" : "2012-10-17",
"Statement" : [
{
"Effect" : "Allow",
"Principal" : {
"Service" : [
"eks.amazonaws.com"
]
},
"Action" : "sts:AssumeRole"
}
]
}

23
modules/iam/main.tf Normal file
View File

@ -0,0 +1,23 @@
resource "aws_iam_role" "iam-role" {
name = var.iam_name
assume_role_policy = var.policy
tags = {
tag-key = var.tag_name
}
}
# {
# "Version" : "2012-10-17",
# "Statement" : [
# {
# "Effect" : "Allow",
# "Principal" : {
# "Service" : [
# "eks.amazonaws.com"
# ]
# },
# "Action" : "sts:AssumeRole"
# }
# ]
# }

4
modules/iam/outputs.tf Normal file
View File

@ -0,0 +1,4 @@
output "iam_name" {
value = aws_iam_role.iam-role.name
}

14
modules/iam/variables.tf Normal file
View File

@ -0,0 +1,14 @@
variable "iam_name" {
description = "value"
type = string
}
variable "policy" {
description = "value"
type = string
}
variable "tag_name" {
description = "value"
type = string
}