Intrinsic Functions for Domain in Serverless API do not work
Description:
Based on this documentation https://github.com/awslabs/serverless-application-model/blob/develop/docs/cloudformation_compatibility.rst#events-properties all intrinsic functions should work for the Domain Object of AWS::Serverless::Api. However if I try something like this.
APIGateway:
Type: AWS::Serverless::Api
Properties:
StageName: Prod
Domain:
!If
- CreateBasePath
- DomainName: test
CertificateArn: test
EndpointConfiguration: REGIONAL
Route53:
HostedZoneId: test
- !Ref "AWS::NoValue"
Auth:
Authorizers:
LambdaTokenAuth:
FunctionPayloadType: TOKEN # OPTIONAL; Defaults to 'TOKEN' when `FunctionArn` is specified
FunctionArn: !GetAtt JWTAuthorizerFunction.Arn
Identity:
ReauthorizeEvery: 0
The deploy fails with: Transform AWS::Serverless-2016-10-31 failed with: Invalid Serverless Applica tion Specification document. Number of errors found: 1. Resource with id [APIGateway] is invalid. Custom Domains only w orks if both DomainName and CertificateArn are provided
I used similar if statements already for Policies and VpcConfig of a lambda function and there they worked perfectly.
Does anybody have an idea?
This was also raised in #1435
@keetonian Any updates on this? Is there at least a workaround? this has been open for a long time.
closing in favor of https://github.com/aws/serverless-application-model/issues/1435