UPD: adding iam-user-policy-name variable

This commit is contained in:
KF 2022-09-19 16:04:26 +08:00
parent 9cc5df4dda
commit 2354b84f84
Signed by: xpk
GPG Key ID: CD4FF6793F09AB86
3 changed files with 4 additions and 2 deletions

View File

@ -9,6 +9,7 @@ module iam-user {
default-tags = local.default-tags default-tags = local.default-tags
iam-user-name = var.iam-user-name iam-user-name = var.iam-user-name
iam-user-policy = data.aws_iam_policy_document.user-policy.json iam-user-policy = data.aws_iam_policy_document.user-policy.json
iam-user-policy-name = "SelfServicePermissions"
create-access-key = false create-access-key = false
create-password = false create-password = false
managed-policy-arns = ["arn:aws:iam::aws:policy/job-function/ViewOnlyAccess"] managed-policy-arns = ["arn:aws:iam::aws:policy/job-function/ViewOnlyAccess"]

View File

@ -11,7 +11,7 @@ resource "aws_iam_access_key" "iam-user-access-key" {
resource "aws_iam_user_policy" "iam-user-policy" { resource "aws_iam_user_policy" "iam-user-policy" {
count = var.create-group ? 0 : 1 count = var.create-group ? 0 : 1
name = "SelfServiceAccess" name = var.iam-user-policy-name
user = aws_iam_user.iam-user.name user = aws_iam_user.iam-user.name
policy = var.iam-user-policy policy = var.iam-user-policy
} }

View File

@ -19,4 +19,5 @@ variable iam-group-name {
variable add-to-groups { variable add-to-groups {
type = list type = list
default = [] default = []
} }
variable iam-user-policy-name {}