localstack / localstack/aws-cdk-local

Flag `--profile` is ignored

Open
#114 1 comment 2 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.