Skip to content

Set an optional permissions boundary on the IAM role, by policy name - #56

Merged
akarolmv merged 2 commits into
mainfrom
iam-role-permissions-boundary
Nov 19, 2026
Merged

akarolmv merged 2 commits into
mainfrom
iam-role-permissions-boundary

Conversation

@akarolmv

@akarolmv akarolmv commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Adds iam_role_permissions_boundary_name, the name of a policy set as the permissions boundary of the function's IAM role. The module builds the policy's ARN from the account the role is created in, so callers can pass one name that exists in every account. It defaults to null, so nothing changes for existing callers.

The boundary is set only when the role is created (lifecycle { ignore_changes = [permissions_boundary] }). A caller that sets the variable on an existing function gets no change to that function's role, so adopting it can't break what the function does at runtime. Only roles created afterwards, or replaced, carry the boundary.

_test sets the variable, and terraform validate passes.

🤖 Generated with Claude Code

`iam_role_permissions_boundary` sets the boundary when the role is created.
`ignore_changes` keeps existing roles as they are when the variable is set
later, so adopting it never changes what a running function may do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@akarolmv akarolmv added the minor label Nov 19, 2026
@deepsource-io

deepsource-io Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 110b75c...36c9827 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Secrets Nov 19, 2026 11:29a.m. Review ↗
Terraform Nov 19, 2026 11:29a.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

A policy's ARN includes its account. A name that exists in every account lets
callers pass one value whatever account the role is in; the module builds the
ARN from the role's account.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@akarolmv akarolmv changed the title Set an optional permissions boundary on the IAM role Set an optional permissions boundary on the IAM role, by policy name Nov 19, 2026
@akarolmv
akarolmv marked this pull request as ready for review November 19, 2026 11:47
@akarolmv akarolmv self-assigned this Nov 19, 2026
@akarolmv
akarolmv merged commit 12076d8 into main Nov 19, 2026
10 checks passed
@akarolmv
akarolmv deleted the iam-role-permissions-boundary branch November 19, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants