Skip to content

feature(iam): Allow an optional permissions boundary #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions modules/lambda-registrator/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ resource "aws_iam_role" "registration" {
]
}
EOF

permissions_boundary = var.aws_iam_permissions_boundary != "" ? var.aws_iam_permissions_boundary : null
}

resource "aws_iam_policy" "policy" {
Expand Down Expand Up @@ -233,8 +235,9 @@ module "eventbridge" {
source = "terraform-aws-modules/eventbridge/aws"
version = "1.17.3"

create_bus = false
role_name = "${var.name}-eventbridge"
create_bus = false
role_name = "${var.name}-eventbridge"
role_permissions_boundary = var.aws_iam_permissions_boundary != "" ? var.aws_iam_permissions_boundary : null

rules = {
"${local.lambda_events_key}" = {
Expand Down
8 changes: 7 additions & 1 deletion modules/lambda-registrator/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,10 @@ variable "arch" {
condition = contains(["arm64", "x86_64"], var.arch)
error_message = "Invalid value for 'arch', options: 'arm64', 'x86_64'."
}
}
}

variable "aws_iam_permissions_boundary" {
description = "Optional Permissions Boundary to add to the created IAM Role."
type = string
default = ""
}