New backend envrionment is created every time we run ci/cd after connecting to the frontend branch with our existing backend env

0

In amplify The new backend envrionment is created every time we run ci/cd after connecting to the frontend branch with our existing backend env (which is staging). This never happened before. Starting from last week, we have to see the new backend env every time we add a new frontend branch to amplify app and connect that to staging env.

There is no amplify folder and aws-exports.json in our repo. we get aws-exports.json during build.

Here is my amplify.yml, which is default one. This situation never happened to me before last week.

version: 1 backend: phases: build: commands: - '# Execute Amplify CLI with the helper script' - amplifyPush --simple frontend: phases: preBuild: commands: - yarn install --ignore-engines build: commands: - yarn run build artifacts: baseDirectory: build files: - '/*' cache: paths: - node_modules//*

asked a month ago27 views
1 Answer
0

The behavior you're describing is not the default or expected behavior for AWS Amplify. Typically, when you connect a new frontend branch to an existing backend environment (like staging), Amplify should use that existing backend environment rather than creating a new one for each CI/CD run.

The fact that this started happening recently suggests there might have been a change in your Amplify configuration or a potential issue with how the backend environment is being referenced.

A few things to consider:

  1. Check your Amplify app settings in the AWS Console to ensure that the backend environments are correctly linked to your frontend branches.

  2. Review any recent changes to your project configuration, especially anything related to Amplify settings or environment variables.

  3. The amplifyPush command in your amplify.yml file should be using the existing backend environment. You might want to try explicitly specifying the environment name:

    amplifyPush --simple --envName staging

  4. Since you mention that you don't have an amplify folder in your repo and get aws-exports.json during build, make sure that the process generating this file is correctly referencing your existing backend environment.

  5. Check if there have been any recent updates to the Amplify CLI or your project dependencies that might have changed this behavior.

If the issue persists, you may want to reach out to AWS support for further assistance, as this behavior is not typical and could indicate a configuration problem or a potential bug in recent Amplify updates.
Sources
AWS Amplify FAQs | Front-End Web & Mobile | Amazon Web Services
AWS Amplify - Code First Development

profile picture
answered a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions