Conversation
aidenvaines-cgi
approved these changes
Sep 16, 2025
Contributor
aidenvaines-cgi
left a comment
There was a problem hiding this comment.
Whilst Policy Attachments is prefered over InLine policies this PR drops from 50 to 22 in just the Template Management repo making IAM limits less of a problem
chris-elliott-nhsd
approved these changes
Sep 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Replaces managed IAM policy resources with inline policies in Lambda module.
Context
We're hitting IAM Policy resource limits in template-management dev. Looking at some sandbox environments, it looks like each sandbox env has
The lambda-related IAM policies in each environment include:
enable_dlq_and_notificationsis true)enable_dlq_and_notificationsis true)This replaces the "logging", "publish" and "send_message" policy resources and adds them as inline policies on the lambda role.
You can have an unlimited number of inline policies up to a total of 10240 characters attached to a role. Here I'm attaching 3 policies, and the total characters will be well under the character limit.
I've left the "main" policy as a managed policy resource as it gives you a 6144 character limit which is separate from the inline limit.
But as an example, this change should reduce the number of IAM policies per templates sandbox environment from 50 to 22.
Type of changes
Checklist
Sensitive Information Declaration
To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.