0

I am trying to map a url like 'https://domain.domain/my-api' to rest api gateway, I use the template like:

...
MyAPI:
  Type: AWS::Serverless::Api
  OpenApiVersion: 3.0.0
  Properties:
    Domain:
      BasePath:
        - !Ref URLBasePath
      CertificateArn: !Ref URLCertArn
      DomainName: !Ref URLDomainName
      EndpointConfiguration: EDGE
      Route53:
        HostedZoneId: !Ref HostedZoneID
...

(URLBasePath = 'my-api' URLDomainName = 'domain.domain')

But instead of 'https://domain.domain/my-api' i get 'https://domain.domain/myapi' (the same happens if I use '_' (https://domain.domain/my_api)), but if I map domain manually via console - it works properly.

Am I doing something wrong, or is it a bug (in sam or cloudformation)?

Thank you.

Andrey
  • 101
  • 1
  • 1

1 Answers1

0

Not sure exactly what are you pasting in your template, but https:// and my-api are not part of a domain. Your DomainName should be only domain.domain.

To specify my-api should use BasePath property.

Marcin
  • 215,873
  • 14
  • 235
  • 294
  • https://domain.domain/my-api is the url I want to use for api gateway. In my template I use URLBasePath = 'my-api' and URLDomainName = 'domain.domain' – Andrey Oct 21 '20 at 21:38
  • @Andrey So did it work? There is no question nor info about any errors in your comment. – Marcin Oct 21 '20 at 21:42
  • I used these parameters from the beginning. Nothing changed, it's just additional information. (or what do you mean?) – Andrey Oct 21 '20 at 22:15