You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In an AWS::Lambda::Permission resource, when specifying SourceArn using !Sub (see attached repro template), cfn-lint complains about missing SourceAccount:
$ cfn-lint -t linttest.yml
E3003 'SourceAccount' is a required property
linttest.yml:27:5
Whereas when using !GetAtt, (!GetAtt HelloLambdaSchedule.Arn), we get no error.
Expected behavior
My understanding is that when SourceArn is specified, SourceAccount isn't strictly required. I found this issue #2155 for which a warning was added in case the SourceAccount is missing, but that's not firing in this case. In this case when SourceArn is specified using !Sub, I would expect either a warning about the usage of !Sub in case that's not guaranteed to provide the account information, or alternatively a warning (instead of an error) about a possibly missing SourceAccount
But even that is specified in cfn-lint documentation as "When configuration a Lambda permission with a SourceArn that doesn't have an AccountId you should also specify the SourceAccount". So if SourceArn includes the account ID, even W3663 shouldn't be necessary.
To many adventures with Fn::Sub so we will remove validation if we run into a Sub. Also fixed the issue where the wrong error number was returned so this will become a warning.
CloudFormation Lint Version
1.9.1
What operating system are you using?
WSL Ubuntu 22.04.4 LTS
Describe the bug
In an
AWS::Lambda::Permission
resource, when specifyingSourceArn
using!Sub
(see attached repro template),cfn-lint
complains about missingSourceAccount
:Whereas when using
!GetAtt
, (!GetAtt HelloLambdaSchedule.Arn
), we get no error.Expected behavior
My understanding is that when
SourceArn
is specified,SourceAccount
isn't strictly required. I found this issue #2155 for which a warning was added in case theSourceAccount
is missing, but that's not firing in this case. In this case whenSourceArn
is specified using!Sub
, I would expect either a warning about the usage of!Sub
in case that's not guaranteed to provide the account information, or alternatively a warning (instead of an error) about a possibly missingSourceAccount
Reproduction template
The text was updated successfully, but these errors were encountered: