amplify-android
amplify-android copied to clipboard
API Gateway endpoint to Cloudfront endpoint
Hello everyone!
Do you know if there is a way to change an API endpoint in amplifyconfiguration.json
to be a CloudFront endpoint?
I have a WAF connected to CloudFront endpoint. This link is associated with an API Gateway URL.
For example:
"apiProject": {
"endpointType": "REST",
"endpoint": "https://xxxxxxxxx.cloudfront.net",
"region": "...",
"authorizationType": "AWS_IAM"
}
The error is:
The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. \n\nThe Canonical String for this request should have been ... host: xxxxxxxxxx.execute-api.xx-xxxxx-x.amazonaws.com
Is there a way to use a CloudFront URL in the endpoint field? Thanks.
@RicardoJC We do not currently support this, no. I've marked #760 as a feature request.
There are a few challenges to confront, to support it.
Firstly, and to the point of your error message, we'd need to update the Sig4 signing. The current implementation hard-codes the service names of the endpoint, as either "appsync"
or "apigateway"
. This assumption would be invalid if the client is communicating with CloudFront, instead.
Another customer requested this feature in https://github.com/aws-amplify/amplify-android/issues/1328, but for Akamai, rather than Cloudfront.