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

"Region" value usage seems inconsistent across client/web-ui #762

Open
nloding opened this issue Nov 27, 2024 · 3 comments
Open

"Region" value usage seems inconsistent across client/web-ui #762

nloding opened this issue Nov 27, 2024 · 3 comments

Comments

@nloding
Copy link

nloding commented Nov 27, 2024

In the lex-web-ui configuration, there are multiple values for region:

{
  "region": "us-east-2",
  "cognito": {
    "aws_cognito_region": "us-east-2",
    "region": "us-east-2"
  },
  "lex": {
    "region": "us-east-1",
  },

Most of my test resources have long been deployed to us-east-2, but Lex v2 only has endpoints in the us-east-1 region. (In other words, Cognitor is us-east-2, Lex is us-east-1 in my configuration.) If I set the top-level region value to "us-east-1", then the Lex runtime instantiates correctly but Cognito fails because it is looking for us-east-1. If I change the top-level region value to "us-east-2", then the reverse happens: Cognito connects, but Lex throws errors (specifically CORS errors because it's trying to hit a us-east-2 runtime endpoint and getting a 404).

I would have expected the cognito.aws_cognito_region or cognito.region and lex.region values to take precedence and not have all the configurations depend on the top-level region value.

The only fix/workaround I have found is to change this line in LexWeb.vue to hardcode the value as "us-east-1".

@atjohns
Copy link
Contributor

atjohns commented Dec 10, 2024

Good catch, I don't think I've ever tried a multi-region deployment before so this has never come up. I will look into it

@bobpskier
Copy link
Contributor

@atjohns @nloding The last I recall, both cognito and lex must be used in the same region. Cognito tokens generated in a different region from where lex service is being called will not be accepted by lex.

@nloding
Copy link
Author

nloding commented Dec 10, 2024

@bobpskier I'll be honest, I have no idea exactly how my local setup is working, but I do know that I have Cognito in us-east-2 and Lex in us-east-1 and the web-ui is working locally. I think the region values should be clarified either way: if you need to have all resources in the same region, then I think it makes sense to remove the individual region values in the configuration and samples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants