localstack / localstack/aws-cdk-local
Flag `--profile` is ignored
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 305
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
I've set up a profile in ~/.aws/config that looks like this:
[profile localstack]
region=eu-west-1
output=json
endpoint_url=http://localhost:4566
And in ~/.aws/credentials I have:
[localstack]
aws_access_key_id=test
aws_secret_access_key=test
aws_default_region=eu-west-1
When I run cdklocal with --profile localstack (which is supported by cdk), the profile flag seems to be ignored as the resources are deployed in the US region.
This can be worked around by exporting the following env variables:
export AWS_REGION=eu-west-1
export AWS_ENVAR_ALLOWLIST=AWS_REGION
However, it would be better to support --profile to be consistent with cdk and be able to use the same flags regardless of the target (and avoid polluting the env with more variables depending on the use case).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the cdklocal --profile localstack command and trace how the CLI handles profile arguments and the AWS environment allowlist. Compare its behavior with the supported cdk flag; done means the profile selects the configured region and endpoint without manually exporting environment variables.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, javascript
- Domain
- cli, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100