aws-amplify / aws-amplify/amplify-hosting
Multiple frontends: What is the workflow for pulling programmatically
- Dominant language
- Dockerfile
- Stars
- 481
- Forks
- 123
- PR merge metrics
- No merged PRs in 30d
Description
**Which Category is your question related to?**
`amplify pull` and https://aws-amplify.github.io/docs/cli-toolchain/quickstart#multiple-frontends
**Amplify CLI Version**
4.12.0
**What AWS Services are you utilizing?**
Amplify, Cognito, Lambda, AppSync and more.
https://aws-amplify.github.io/docs/cli-toolchain/quickstart#multiple-frontends
I have three environments maintained in a separate repository. That repository only contains my back-end. When pulling my back-end into another front-end project, I discovered several limiting factors:
1. I cannot create a separate back-end via `amplify init` (to effectively only use what I need from the externalized back-end), because any future `amplify pull` will only attempt to pull from this new back-end, and not the externalized back-end. This seems to remove amplify as a hosting option, because this front-end cannot be turned into an amplify project. I have to choose between turning this project into an amplify project and the ability to pull a fresh externalized back-end config into this project. No big deal, I can just do the hosting myself, right?
2. `aws-exports.js` isn't meant to be committed, and every `amplify pull`, with a differing target environment, resets the file with the environment specific configuration. This means that I have to program a build step that detects the environment and pulls the correct environment. Not the worst situation, but `3` makes it difficult.
3. There isn't any documentation regarding pulling and generating the `aws-exports.js` programmatically. The documentation given [here](https://aws-amplify.github.io/docs/cli-toolchain/quickstart#multiple-frontends) expects users to answer questions via the CLI. I'm not guaranteed that the CLI flow will remain the same. If I'd like to pull from an environment, during build, I'd like to know my build step won't break with an upgrade to the amplify CLI.
How can I checkout particular environments if this front-end project cannot be converted into an amplify project? Can I still use the amplify console, for hosting, when the back-end is externalized?
It would be nice if I could both externalize my back-end, and treat this front-end project as an amplify project.
If I have to do my own hosting, then some docs under the "multiple-frontends" section for pulling multiple environments programmatically (as opposed to answering questions via the cli) is needed. And I hope it works across major and minor version changes.
Contributor guide
Assessment
This issue has not been assessed yet.