From 2354b84f848418d662248c4e92554b5dcfae5212 Mon Sep 17 00:00:00 2001 From: KF Date: Mon, 19 Sep 2022 16:04:26 +0800 Subject: [PATCH] UPD: adding iam-user-policy-name variable --- modules/security_identity_compliance/iam-user/README.md | 1 + modules/security_identity_compliance/iam-user/main.tf | 2 +- modules/security_identity_compliance/iam-user/variables.tf | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/security_identity_compliance/iam-user/README.md b/modules/security_identity_compliance/iam-user/README.md index 3725a21..aba1001 100644 --- a/modules/security_identity_compliance/iam-user/README.md +++ b/modules/security_identity_compliance/iam-user/README.md @@ -9,6 +9,7 @@ module iam-user { default-tags = local.default-tags iam-user-name = var.iam-user-name iam-user-policy = data.aws_iam_policy_document.user-policy.json + iam-user-policy-name = "SelfServicePermissions" create-access-key = false create-password = false managed-policy-arns = ["arn:aws:iam::aws:policy/job-function/ViewOnlyAccess"] diff --git a/modules/security_identity_compliance/iam-user/main.tf b/modules/security_identity_compliance/iam-user/main.tf index 10e4b7f..54819a7 100644 --- a/modules/security_identity_compliance/iam-user/main.tf +++ b/modules/security_identity_compliance/iam-user/main.tf @@ -11,7 +11,7 @@ resource "aws_iam_access_key" "iam-user-access-key" { resource "aws_iam_user_policy" "iam-user-policy" { count = var.create-group ? 0 : 1 - name = "SelfServiceAccess" + name = var.iam-user-policy-name user = aws_iam_user.iam-user.name policy = var.iam-user-policy } diff --git a/modules/security_identity_compliance/iam-user/variables.tf b/modules/security_identity_compliance/iam-user/variables.tf index f3987e7..f046c0d 100644 --- a/modules/security_identity_compliance/iam-user/variables.tf +++ b/modules/security_identity_compliance/iam-user/variables.tf @@ -19,4 +19,5 @@ variable iam-group-name { variable add-to-groups { type = list default = [] -} \ No newline at end of file +} +variable iam-user-policy-name {} \ No newline at end of file