-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
There's no way to provide comma-separated config values through the configuration
argument.
For example, I want to specify a list of services via the SERVICES
config variable (e.g., SERVICES=s3,ec2,secretsmanager,ecs,iam,sts,fis
). However, the configuration parsing code naively splits the provided string on commas:
localstack-dagger-module/src/localstack/main.py
Lines 47 to 52 in 6e2683e
# Add configuration variables if provided | |
if configuration: | |
for config_pair in configuration.split(','): | |
if '=' in config_pair: | |
key, value = config_pair.strip().split('=', 1) | |
container = container.with_env_variable(key, value) |
As such, when specifying configuration as follows, ec2
is recognized as a separate config variable rather than another service in the list of services that comprise the value for the SERVICES
config variable:
dag.Localstack().Start(dag.LocalstackStartOpts{
Configuration: "SERVICES=s3,ec2,secretsmanager,ecs,iam,sts,fis"
})
There are a few solutions to this:
- use a non-comma delimiter to distinguish configuration key-value pairs (e.g., use
;
as the delimiter:"SERVICES=s3,ec2,secretsmanager;AWS_DEFAULT_REGION=east-us-1"
) - accommodate escaped quotes (e.g.,
"SERVICES=\"s3,ec2,secretsmanager\",AWS_DEFAULT_REGION=east-us-1"
)
shykes
Metadata
Metadata
Assignees
Labels
No labels