aws / aws/chalice

--profile Flag Not Honored During Build Phase

Open
#573 6 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
11.1k
Forks
1k
Avg merge
1d 22h
Merged PRs (30d)
2

Description

It looks like when you specify the --profile flag, it still uses the AWS default profile while building up the package swagger json. For deployment, it does use the --profile flag to deploy to the correct environment, however.

Here's the use case: in our app.py we are defining a CognitoUserPoolAuthorizer() to be used. However, the cognito user pool arn differs by environment/profile. We've setup a dynamo DB to store certain sensitive configuration values (https://github.com/fugue/credstash) like our cognito pool arn. So for our dev environment, we've setup a dev profile that contains the correct values in the dynamo DB for that environment; prod has a different profile/different values; etc. When we build, even though we've set the --profile flag properly, if we don't set the AWS default profile to the right values, it fails to deploy.

The problem seems to be that those values need to be resolved when generating the swagger document and during that time, it looks like the --profile flag isn't getting used.

Contributor guide

Open the contributing guide

Research direction

Start with app.py and trace the build path that generates the Swagger document, focusing on how --profile is propagated while CognitoUserPoolAuthorizer values are resolved. Reproduce with separate AWS profiles and environment-specific Cognito ARNs; done means the selected profile is used during build as well as deployment.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
api, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.