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

Nested stack API Gateway Lambda authorizer URI parameter incorrectly fails I3042:accountId check #3716

Closed
Slooz opened this issue Sep 25, 2024 · 0 comments · Fixed by #3720
Closed

Comments

@Slooz
Copy link

Slooz commented Sep 25, 2024

CloudFormation Lint Version

1.15.1

What operating system are you using?

Mac

Describe the bug

Continuation of #3683. #3683 fixed the issue when the URI is passed to a resource type of AWS::ApiGateway::Authorizer, but the issue persists when the URI is passed as a parameter for a resource type of AWS::CloudFormation::Stack.

cfn-lint expects the :lambda: segment of the stack API Gateway Lambda authorizer URI parameter 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
10:9:               I3042     ARN in Resource Stack contains hardcoded AccountId in ARN or incorrectly placed Pseudo Parameters

Expected behavior

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

Reproduction template

AWSTemplateFormatVersion: 2010-09-09
Resources:
  Stack:
    Type: AWS::CloudFormation::Stack
    DeletionPolicy: Delete
    UpdateReplacePolicy: Delete
    Properties:
      TemplateURL: !Sub https://s3_bucket_name.s3.${AWS::Region}.amazonaws.com/template.yaml
      Parameters:
        AuthorizerUri: !Sub arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:FunctionName/invocations
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