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

Intrinsic Functions for Domain in Serverless API do not work #1566

Closed
christophsteiner opened this issue Apr 20, 2020 · 3 comments
Closed

Intrinsic Functions for Domain in Serverless API do not work #1566

christophsteiner opened this issue Apr 20, 2020 · 3 comments
Labels
area/intrinsics Ref, If, Sub, GetAtt, ...

Comments

@christophsteiner
Copy link

christophsteiner commented Apr 20, 2020

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?

@keetonian keetonian added the area/intrinsics Ref, If, Sub, GetAtt, ... label Apr 21, 2020
@brysontyrrell
Copy link
Contributor

This was also raised in #1435

@kakhaUrigashvili
Copy link

@keetonian Any updates on this? Is there at least a workaround? this has been open for a long time.

@elbayaaa
Copy link
Contributor

closing in favor of #1435

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/intrinsics Ref, If, Sub, GetAtt, ...
Projects
None yet
Development

No branches or pull requests

5 participants