Skip to content

Commit

Permalink
feat: add option to specify role name (#12)
Browse files Browse the repository at this point in the history
Co-authored-by: Eugen Podaru <eugen.podaru@knab.nl>
  • Loading branch information
eugenpodaru and eugenpodaru committed Jan 2, 2024
1 parent 1900820 commit 5d2463b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ data "aws_iam_policy_document" "assume_role" {

resource "aws_iam_role" "this" {
path = "/lambda/"
name_prefix = var.function_name
name = var.role_name
name_prefix = var.role_name != null ? null : var.function_name

assume_role_policy = data.aws_iam_policy_document.assume_role.json
}
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ variable "log_kms_key_id" {
default = null
}

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

variable "existing_policy_arns" {
type = set(string)
default = []
Expand Down

0 comments on commit 5d2463b

Please sign in to comment.