Skip to content

Conversation

@madsid
Copy link

@madsid madsid commented Nov 10, 2025

Issue #, if available

#3736

Description of changes

Support AWS::NoValue conditional for Role property in AWS::Serverless::Function

Role is an optional string value for AWS::Serverless::Function. An execution role is auto generated code when the value is None. This change adds support for AWS::NoValue.

Use cases :

  1. Role string passed though as is.
  2. Role If conditional with both AWS::NoValue creates an execution role for both true and false case and replaces AWS::NoValue
  3. Role if conditional with 1 AWS::NoValue creates an execution role and replaces AWS::NoValue
  4. Role value with Fn::GetAtt gets passed through as is.

Description of how you validated changes

  • Added unit tests
  • Hand tested sam-translate.py with templates and verified translated templates

Checklist

Examples?

Please reach out in the comments if you want to add an example. Examples will be
added to sam init through aws/aws-sam-cli-app-templates.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@madsid madsid requested a review from a team as a code owner November 10, 2025 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant