1

I setup my domain on API gateway to use API calls with domain.

When I call base url with domain I got S3 error instead lambda result.

<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>v1/mystage</Key>
<RequestId>ED11385C2BCE1D98</RequestId>
<HostId>
6QOcio6aofUYI2sTDsxJxE6BR06UfxKvNRT+L12QxGhvJvsmuJB4BYwgexYtPK++4K919Nh9bTM=
</HostId>
</Error>

can anyone clarify whether if its possible to use my domain in API gateway but its already used for S3 static website hosting?

Tek
  • 109
  • 2
  • 9
  • [How to serve an AWS EC2 instance from S3 Subdirectory](https://stackoverflow.com/q/60474201/1695906) isn't an exact duplicate, but provides some additional details of serving S3 plus something else (EC2 instead of API Gateway, but the concepts are similar) from the same domain, via CloudFront. – Michael - sqlbot Mar 05 '20 at 00:15

1 Answers1

0

If you need to use same domain for multiple resources you need to setup CloudFront distribution and configure different origins and behaviors for them, based on URI

Ivan Shumov
  • 626
  • 3
  • 6