serverless-application-model
serverless-application-model copied to clipboard
AWS::Serverless::Api - Auth property doesn't allow intrinsic functionality
The intrinsic mapping for Auth on APIs does not appear to have been added in v1.16 or v1.20.0 from what I can see. I can see intrinsic mapping for function deployment preferences was in (https://github.com/awslabs/serverless-application-model/issues/1196)
Could this please be added to the roadmap?
Here are some test templates:
Works
Transform: AWS::Serverless-2016-10-31
Parameters:
VpcParameter:
Type: String
Resources:
ApiGateway:
Type: AWS::Serverless::Api
Properties:
StageName: Prod
EndpointConfiguration: PRIVATE
Auth:
ResourcePolicy:
SourceVpcWhitelist:
- !Ref VpcParameter
Func:
Type: AWS::Serverless::Function
Properties:
Runtime: python3.7
InlineCode: |
def handler(event, context):
return {'statusCode': 200, 'body': 'OK'}
Handler: "index.handler"
Events:
Whatever:
Type: Api
Properties:
RestApiId: !Ref ApiGateway
Method: GET
Path: /
Fails
Transform: AWS::Serverless-2016-10-31
Resources:
VpcResource:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.0.0.0/16
ApiGateway:
Type: AWS::Serverless::Api
Properties:
StageName: Prod
EndpointConfiguration: PRIVATE
Auth:
ResourcePolicy:
SourceVpcWhitelist:
- !Ref VpcResource
Func:
Type: AWS::Serverless::Function
Properties:
Runtime: python3.7
InlineCode: |
def handler(event, context):
return {'statusCode': 200, 'body': 'OK'}
Handler: "index.handler"
Events:
Whatever:
Type: Api
Properties:
RestApiId: !Ref ApiGateway
Method: GET
Path: /
We would like to use an !ImportValue for the VPC, that fails too (but doesn't fit in a single demo template)
Closing in favor of https://github.com/aws/serverless-application-model/issues/2533.