aws-amplify / aws-amplify/amplify-hosting
Amplify build on hosting deletes backend resources
- Dominant language
- Dockerfile
- Stars
- 481
- Forks
- 123
- PR merge metrics
- No merged PRs in 30d
Description
### Before opening, please confirm:
- [X] I have checked to see if my question is addressed in the [FAQ](https://github.com/aws-amplify/amplify-hosting/blob/master/FAQ.md).
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-hosting/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-hosting/blob/master/CONTRIBUTING.md).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
### App Id
d1sssy1xajmiw6 (or) d2k9s3oqtigcln
### Region
us-east-1 or eu-west-1
### Amplify Hosting feature
Backend builds
### Describe the bug
When deploying a frontend(using github) with the build settings in the repository. The build settings do not have backend commands in the script.
On pushing using the amplify CLI to push a resource first, deploying the frond end that contains a amplify folder without the resource. I observed that the backend build run which then deleted the resource added to the backend on the push before.
### Expected behavior
Not delete the backend resource and not build backend when no backend commands are mentioned
### Reproduction steps
1. Create react app
2. amplify init
3. add amplify.yml in root of the app with the build settings given.
4. create git repo and push app to repo.
5. amplify add function.
6. amplify push
7. On CLI push finish, connect git repo to hosting
### Build Settings
```yaml
version: 1
frontend:
phases:
preBuild:
commands:
- yarn install
build:
commands:
- echo "REACT_APP_USER_BRANCH=$USER_BRANCH" >> .env
- yarn run build
artifacts:
baseDirectory: build
files:
- "**/*"
cache:
paths:
- node_modules/**/*
```
### Additional information
_No response_
Contributor guide
Research direction
Start by reproducing the issue with the listed React, Amplify CLI, GitHub, and amplify.yml steps in the affected regions. Inspect the Hosting backend-build behavior when no backend commands are present; done means frontend deployment no longer builds or deletes previously pushed backend resources.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, github, react
- Domain
- backend, ci-cd, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100