-
Notifications
You must be signed in to change notification settings - Fork 625
Open
Description
CloudFormation Lint Version
cfn-lint 1.43.4
What operating system are you using?
Debian 13
Describe the bug
AWS Managed Policies from this list are accepted, as one can see in the documentation.
Managed policies used in ifs are validated as ARNs.
E3031 'CloudWatchLambdaInsightsExecutionRolePolicy' does not match 'arn:(aws[a-zA-Z-]*)?:iam::(\\d{12}|aws):policy/[a-zA-Z_0-9+=,.@\\-_/]+'
template.yaml:17:24
Expected behavior
The validation should pass
Reproduction template
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Conditions:
IsTrue: true
Resources:
ExampleFunction:
Type: AWS::Serverless::Function
Properties:
Runtime: python3.12
Handler: handler
InlineCode: >
def handler():
pass
Policies:
- !If [IsTrue, CloudWatchLambdaInsightsExecutionRolePolicy, !Ref AWS::NoValue] # This line does not pass
- Fn::If: #
- IsTrue #
- AWSLambdaExecute # This line does not pass
- !Ref AWS::NoValue #
- CloudWatchLambdaInsightsExecutionRolePolicy # This line passReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels