Zappa: Zappa does not recognise a deployed project after changing the AWS secret keys

Context

I have a deployed project with Zappa v0.47.0. After rotating my secret keys for AWS Zappa does not recognise that the project is already deployed. I have a virtual env with python 3.6.0

Expected Behavior

“zappa update dev” updates the deployed project

Actual Behavior

“zappa update dev” returns: Warning! Couldn't get function projectname-dev in us-east-1 - have you deployed yet?

Possible Fix

I don’t have an idea

Steps to Reproduce

  1. zappa deploy dev your project. 1.2. zappa update dev your project to check its working if you want.
  2. create new AWS keys in the AWS IAM console.
  3. disable and remove the old keys in the AWS IAM console.
  4. try to zappa update dev your project

Your Environment

  • Zappa version used: 0.47.0.
  • Operating System and Python version: Windows 10 with Python 3.6.0
  • The output of pip freeze: apipkg==1.5 argcomplete==1.9.3 asn1crypto==0.24.0 atomicwrites==1.2.1 attrs==18.2.0 awsebcli==3.14.6 backcall==0.1.0 base58==1.0.0 beautifulsoup4==4.6.3 boto3==1.9.23 botocore==1.12.23 CacheControl==0.12.5 cchardet==1.1.3 cement==2.8.2 certifi==2018.8.24 cffi==1.11.5 cfn-flip==1.0.3 chardet==3.0.4 click==6.7 colorama==0.3.9 configparser==3.5.0 coverage==4.5.1 cryptography==2.3.1 cssselect==1.0.3 datadotworld==1.6.0 datapackage==0.8.9 decorator==4.3.0 diff-match-patch==20121119 Django==2.1.2 django-debug-toolbar==1.10.1 django-extensions==2.1.3 django-import-export==1.1.0 django-rest-auth==0.9.3 django-s3-storage==0.12.4 django-storages==1.7.1 django-webtest==1.9.3 djangorestframework==3.8.2 docutils==0.14 drf-extensions==0.4.0 durationpy==0.5 et-xmlfile==1.0.1 execnet==1.5.0 flake8==3.5.0 flake8-polyfill==1.0.2 freezegun==0.3.11 future==0.16.0 hjson==3.0.1 idna==2.7 ijson==2.3 ipdb==0.11 ipython==7.0.1 ipython-genutils==0.2.0 isodate==0.6.0 jdcal==1.4 jedi==0.13.0 jmespath==0.9.3 jsonlines==1.2.0 jsonschema==2.6.0 jsontableschema==0.10.1 kappa==0.6.0 lambda-packages==0.20.0 linear-tsv==1.1.0 lxml==4.2.5 mccabe==0.6.1 mock==2.0.0 model-mommy==1.6.0 more-itertools==4.3.0 msgpack==0.5.6 mysqlclient==1.3.13 odfpy==1.3.6 openpyxl==2.5.8 parso==0.3.1 pathspec==0.5.5 pbr==4.2.0 pep8==1.7.1 pep8-naming==0.7.0 pickleshare==0.7.5 Pillow==5.3.0 placebo==0.8.2 pluggy==0.7.1 prompt-toolkit==2.0.5 psycopg2==2.7.5 py==1.6.0 pycodestyle==2.3.1 pycparser==2.19 pyflakes==1.6.0 Pygments==2.2.0 PyMySQL==0.9.2 pyquery==1.4.0 pytest==3.8.2 pytest-cache==1.0 pytest-cov==2.6.0 pytest-django==3.4.3 pytest-flake8==1.0.2 pytest-pep8==1.0.6 python-coveralls==2.9.1 python-dateutil==2.6.1 python-slugify==1.2.4 pytz==2018.5 PyYAML==3.13 requests==2.19.1 rfc3986==0.4.1 s3transfer==0.1.13 semantic-version==2.5.0 sh==1.12.14 simplegeneric==0.8.1 six==1.11.0 SQLAlchemy==1.2.12 sqlparse==0.2.4 tablib==0.12.1 tabulator==1.4.1 termcolor==1.1.0 toml==0.10.0 tqdm==4.19.1 traitlets==4.3.2 troposphere==2.3.3 unicodecsv==0.14.1 Unidecode==1.0.22 urllib3==1.22 waitress==1.1.0 wcwidth==0.1.7 WebOb==1.8.2 WebTest==2.0.30 Werkzeug==0.14.1 whitenoise==4.1 wsgi-request-logger==0.4.6 xlrd==1.1.0 xlwt==1.3.0 zappa==0.47.0
  • Link to your project (optional): not required
  • Your zappa_settings.py: can’t share my full zappa settings for security reasons { “dev”: { “aws_region”: “us-east-1”, “django_settings”: “myproject.settings”, “profile_name”: “default”, “project_name”: “myproject”, “runtime”: “python3.6”, “s3_bucket”: “zappa-dev-package”, “environment_variables”: { “DJANGO_CONF”: “aws_lambda” }, “manage_roles”: false, “role_name”: “my zappa role name”, “role_arn”: “my zappa role arn”, “vpc_config”: { “SubnetIds”: [ “subnet-a”, “subnet-b”, “subnet-c”, “subnet-d”, “subnet-e”, “subnet-f” ], “SecurityGroupIds”: [ “sg-my-sec-group” ] } } }

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 15

Most upvoted comments

I’m running into a similar though slightly different issue. I can zappa deploy and update a function locally, but when my circleci script tries running zappa update it says it can’t find the already deployed function (even though I can see it in the Lambda console panel). How did you use aws configure to fix your problem?

aws configure fixed my problem

I get the same error when trying to update an already deployed zappa application with codebuild.

Warning! Couldn't get function projectname-dev in us-east-1 - have you deployed yet?

The suggestion of aws configure errors, presumably because it’s using a role not an access key.

[Container] 2023/02/27 23:07:14 Running command aws configure
--
220 | AWS Access Key ID [None]:
221 | EOF when reading a line

so, I’m not really sure how to proceed.

Updating the creds with aws configure didn’t solve it for me. Then I realized that since I was using AWS profiles set up in ~/.aws/config and ~/.aws/credentials, your zappa setting for “profile” must match the AWS profile name in the config file, now what you have set in your local env.

@zyd14, @thesunlover, thanks for the quick reply! I was experiencing the issue because there were insufficient permissions for the AWS user used by the Bamboo build plan. Added full access to API Gateway, Lambda, and CloudFormation and worked just fine.

@Miserlou, how do you think, maybe additional more verbose error description would help somehow other people in the future?