amplify-cli-action
amplify-cli-action copied to clipboard
prod environment does not exist, consider using add_env command instead
When I use amplify_env: prod it gives the above error but when I used amplify_env: dev it works fine why?
Environment names are arbitrary but must exist in AWS, by default $ amplify init
command only instantiates a dev
env.
While README.md for Github Actions template mentions prod
as the default target, you're still required to add it to your AWS resource.
- name: configure amplify
uses: ambientlight/[email protected]
with:
amplify_command: configure
amplify_env: prod # Environment name that exists in CloudFormation Amplify target
- name: deploy
uses: ambientlight/[email protected]
with:
amplify_command: publish
amplify_env: prod # Environment name that exists in CloudFormation Amplify target
See Amplify Docs on adding environments using the command $ amplify env add
.
I'm also having this issue. I've specified my amplify_env
in my template, and the env exists in the amplify app on both FE/BE so I don't know why this isn't working. My amplify_cli_version
is 6.1.0
.
- name: configure amplify
uses: ambientlight/[email protected]
with:
amplify_command: configure
amplify_env: main
project_dir: client
amplify_cli_version: 6.1.0
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-2
It looks like the following line from entrypoint.sh
isn't working as of 6.1.0
:
# if environment doesn't exist fail explicitly
if [ -z "$(amplify env get --name $6 | grep 'No environment found')" ] ; then
echo "found existing environment $6"
amplify env pull --yes $9
else
echo "$6 environment does not exist, consider using add_env command instead";
exit 1
fi
In my local testing, it seems amplify env get
checks local envs, not ones in AWS. This env would need to be pulled using amplify pull --envName $ENV_NAME
to be able to use amplify env get
to get its details.
why there is no way to specific appid?
why there is no way to specific appid?
My question too