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).
I've set up a profile in
~/.aws/configthat looks like this:And in
~/.aws/credentialsI have:When I run
cdklocalwith--profile localstack(which is supported bycdk), 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:
However, it would be better to support
--profileto be consistent withcdkand be able to use the same flags regardless of the target (and avoid polluting the env with more variables depending on the use case).