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

Add service_info to API Config (want to use custom domain at endpoint) #72

Closed
70-10 opened this issue Dec 15, 2017 · 2 comments
Closed
Labels
feature-request Request a new feature
Projects

Comments

@70-10
Copy link

70-10 commented Dec 15, 2017

Hi.
I can't English. I use Google Translate.
I'm sorry if I do not understand the sentences I wrote...

I want to be able to set serice_info as below ↓

Amplify.configure({
  Auth: {
    identityPoolId: "ap-northeast-1:********-****-****-****-************",
    region: "ap-northeast-1",
    userPoolId: "ap-northeast-1_*********",
    userPoolWebClientId: "**************************"
  },
  API: {
    endpoints: [
      {
        name: "API",
        endpoint: "https://custom-domain.com",
        service_info: {
          service: "execute-api",
          region: "ap-northeast-1"
        }
      }
    ]
  }
}

I could not resolve the service_info and it caused an error when I made the endpoint of the API a custom domain.

parse_service_info is expecting /([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com$/.
service_info.region and service_info.serivce are always null when you are in a custom domain.
https://github.com/aws/aws-amplify/blob/master/packages/aws-amplify/src/Common/Signer.ts#L104

parse_service_info doesn't execute when service_info exists.
https://github.com/aws/aws-amplify/blob/master/packages/aws-amplify/src/Common/Signer.ts#L249

But always execute parse_service_info, because RestClient does not setting service_info.
https://github.com/aws/aws-amplify/blob/master/packages/aws-amplify/src/API/RestClient.ts#L165

I think it will solve it, if you can pass the service_info set in config to the third argument when Signer.sign calls.

@mlabieniec mlabieniec added the feature-request Request a new feature label Dec 19, 2017
@mlabieniec mlabieniec added this to Icebox in aws-amplify via automation Dec 19, 2017
@mlabieniec
Copy link
Contributor

mlabieniec commented Feb 23, 2018

Added support for service_info and custom domains in PR #321

aws-amplify automation moved this from Backlog to Released Feb 23, 2018
@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request a new feature
Projects
No open projects
aws-amplify
  
@beta
Development

No branches or pull requests

2 participants