Skip to content

Commit ad70fec

Browse files
authored
role_name to be specified
2 parents a38912b + 1f34d87 commit ad70fec

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ resource "aws_iam_policy" "this" {
2727
}
2828

2929
resource "aws_iam_role" "this" {
30-
name_prefix = "grid-cloud"
30+
name_prefix = var.role_name != null ? null : "grid-cloud"
31+
name = var.role_name
32+
3133
max_session_duration = 12 * 3600
3234
assume_role_policy = jsonencode({
3335
Statement = flatten([

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,8 @@ variable "extra_assume_role_without_external_id_arn" {
2222
default = []
2323
description = "[Advance]\n[DANGEROUS]\nAny extra AWS Principal who can assume this role without external ID"
2424
}
25+
26+
variable "role_name" {
27+
type = string
28+
default = null
29+
}

0 commit comments

Comments
 (0)