Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Gateway Lambda authorizer URI incorrectly fails I3042:accountId check #3683

Closed
Slooz opened this issue Sep 11, 2024 · 1 comment · Fixed by #3684
Closed

API Gateway Lambda authorizer URI incorrectly fails I3042:accountId check #3683

Slooz opened this issue Sep 11, 2024 · 1 comment · Fixed by #3684

Comments

@Slooz
Copy link

Slooz commented Sep 11, 2024

CloudFormation Lint Version

1.12.4

What operating system are you using?

Mac/Ubuntu

Describe the bug

cfn-lint expects the :lambda: segment of the API Gateway Lambda authorizer URI to not be a hardcoded account ID, when the :lambda: segment should be hardcoded to lambda.

$ cfn-lint --format pretty --regions us-east-2 --include-checks I --configure-rule E3012:strict=True I3042:region=True I3042:accountId=True -- template.yaml
template.yaml
6:7:                I3042     ARN in Resource Resource contains hardcoded AccountId in ARN or incorrectly placed Pseudo Parameters

Expected behavior

API Gateway Lambda authorizer URI doesn't fail I3042:accountId check

Reproduction template

AWSTemplateFormatVersion: 2010-09-09
Resources:
  Resource:
    Type: AWS::ApiGateway::Authorizer
    Properties:
      AuthorizerUri: !Sub arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:Name/invocations
      RestApiId: RestApiId
      Type: REQUEST
      Name: Name
@Slooz
Copy link
Author

Slooz commented Sep 11, 2024

Thanks @kddejong!

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 a pull request may close this issue.

1 participant