amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

New deployment isn't connected to a backend on the console by default.

Open duckbytes opened this issue 2 years ago • 1 comments

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

16

Amplify CLI Version

12.10.1, 12.8.2

What operating system are you using?

Linux

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No manual changes made

Describe the bug

I'm deploying new backends to a single app using pattern matched branch detection. On pushing a new branch, the resources are successfully deployed, however on the console there is no listed backend associated with the hosting environment. Looking in the logs I can see the name of the backend environment, and subsequent pushes still successfully trigger a build.

When running the command:

aws amplify get-branch --app-id "$APP_ID" --branch-name "$BRANCH_NAME" | jq -r ".branch.backendEnvironmentArn"

This returns no value because branchEnvironmentArn is not returned. However if I go to the console and click (Edit) on the new Hosting environment, I can manually set it to the new backend. Once that is done, the command successfully returns data.

The reason I need this data is because I'm making changes to my github action so that it returns data including the environment name and graphql endpoint. The action doesn't work until I make the manual change in the console and run the workflow again.

For reference this is the bash script that gets this data: https://github.com/duckbytes/amplify-build-status/blob/get_env_name/entrypoint.sh Function get_backend_env_name fails to get the env name.

My amplify.yml file https://github.com/platelet-app/platelet/blob/production/another.platelet.app/amplify.yml

image

Here you can see the top environment has a backend, but the new branch below only says "deploys set up (Edit)".

I've tried with both the default amplify version (which seems to be at 12.8.2) and with an override to 12.10.1

Expected behavior

I expect the command aws amplify get-branch --app-id "$APP_ID" --branch-name "$BRANCH_NAME" to return branch.backendEnvironmentArn straight away without any manual intervention.

Reproduction steps

  • Connect to a GitHub repository on the Amplify console.
  • Set up branch pattern matching to production/**
  • Deploy a new branch by checking it out and pushing it up.
  • Observe on the amplify console the new deployment.

Project Identifier

2b5bca2df2d2fa50161f43dec1f15951

Log output

# Put your logs below this line


Additional information

No response

Before submitting, please confirm:

  • [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • [X] I have removed any sensitive information from my code snippets and submission.

duckbytes avatar Mar 31 '24 21:03 duckbytes

Hey @duckbytes, apologies on the delay in a response. Did a quick test did not observe this behavior. For technical support and deeper dive into the project on Amplify hosting, we encourage you to open a case with AWS technical support if you have AWS support plan. If you do not have an active AWS support plan, we encourage you to leverage our Amplify community Discord server where community members and staff try to help each other with Amplify.

ykethan avatar Apr 15 '24 15:04 ykethan

Closing the issue due to inactivity. Do reach out if you require any assistance with Amplify CLI.

ykethan avatar May 07 '24 20:05 ykethan

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.

github-actions[bot] avatar May 07 '24 20:05 github-actions[bot]