aws-amplify / aws-amplify/amplify-cli
[Geo] `amplify add geo` generates unexpected keys in `aws-exports.js` (`amazon_location_service` vs `AmazonLocationService`)
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 825
- Avg merge
- 11d 23h
- Merged PRs (30d)
- 2
Description
### Before opening, please confirm:
- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/master/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
### How did you install the Amplify CLI?
npm i -g @aws-amplify/cli
### If applicable, what version of Node.js are you using?
v16.10.0
### Amplify CLI Version
6.2.1
### What operating system are you using?
macOS
### Amplify Categories
Not applicable
### Amplify Commands
add
### Describe the bug
`amplify add geo` created an `aws-exports.js` that looks like:
```javascript
/* eslint-disable */
// WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.
const awsmobile = {
"aws_project_region": "us-west-2",
"aws_cognito_identity_pool_id": "",
"aws_cognito_region": "us-west-2",
"aws_user_pools_id": "",
"aws_user_pools_web_client_id": "",
"oauth": {},
"aws_cognito_login_mechanisms": [
"PREFERRED_USERNAME"
],
"aws_cognito_signup_attributes": [
"EMAIL"
],
"aws_cognito_mfa_configuration": "OFF",
"aws_cognito_mfa_types": [
"SMS"
],
"aws_cognito_password_protection_settings": {
"passwordPolicyMinLength": 8,
"passwordPolicyCharacters": []
},
"aws_cognito_verification_mechanisms": [
"EMAIL"
],
"geo": {
"amazon_location_service": {
"maps": {
"items": {
"maplibrereact-dev": {
"style": "VectorEsriStreets"
}
},
"default": "maplibrereact-dev"
},
"region": "us-west-2"
}
}
};
export default awsmobile;
```
The `geo` section does not match what's [documented](https://docs.amplify.aws/lib/geo/existing-resources/q/platform/js/#authorization-permissions), which is a key named `AmazonLocationService`.
While this appears to work (yay backward-compatibility), this is confusing and threw me for a loop.
### Expected behavior
`amplify add geo` should create a section that looks like:
```javascript
{
// ...
"geo": {
"AmazonLocationService": {
// ...
}
}
}
```
### Reproduction steps
1. run `amplify add geo` with defaults
### GraphQL schema(s)
```graphql
# Put schemas below this line
```
### Log output
```
# Put your logs below this line
```
### Additional information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.