Skip to content

Commit

Permalink
role_name to be specified
Browse files Browse the repository at this point in the history
  • Loading branch information
nmiculinic authored Oct 19, 2021
2 parents a38912b + 1f34d87 commit ad70fec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ resource "aws_iam_policy" "this" {
}

resource "aws_iam_role" "this" {
name_prefix = "grid-cloud"
name_prefix = var.role_name != null ? null : "grid-cloud"
name = var.role_name

max_session_duration = 12 * 3600
assume_role_policy = jsonencode({
Statement = flatten([
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ variable "extra_assume_role_without_external_id_arn" {
default = []
description = "[Advance]\n[DANGEROUS]\nAny extra AWS Principal who can assume this role without external ID"
}

variable "role_name" {
type = string
default = null
}

0 comments on commit ad70fec

Please sign in to comment.