Skip to content

Accommodate comma-separated config values #4

@kirklandnuts

Description

@kirklandnuts

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:

# 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:

  1. 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")
  2. accommodate escaped quotes (e.g., "SERVICES=\"s3,ec2,secretsmanager\",AWS_DEFAULT_REGION=east-us-1")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions