Skip to content

SourceVpcWhitelist is unable to resolve intrinsic functions #1249

@sanjP10

Description

@sanjP10

Description:

Within the Auth object, trying to use SourceVpcWhitelist and finding that intrinsic functions are causing issues with cloudformation creating or updating a stack.

https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api-auth-object

...
Auth:
  DefaultAuthorizer: AWS_IAM
    ResourcePolicy:
      SourceVpcWhitelist:
        - !Ref VPCEndpoint
...

Steps to reproduce the issue:

  1. Create an Serveless::API with a vpc or vpcendpoint
  2. Put the above into the Auth section for resource policies

Observed result:
Transform AWS::Serverless-2016-10-31 failed with: Internal transform failure.

cfn-lint returns E0001 Error transforming template: expected string or bytes-like object.

Expected result:

Cloudformation updates stack and is able to resolve the intrinsic functions

Note
If you do not use intrinsic functions like !Sub or !Ref this works fine
I have not tried this on the other options. I have tried with CustomStatements and had no issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions