AWS SAM samconfig.toml file not picking up the custom environment using --config-env

Viewed 1552

Working on a SAM application where I have multiple environments. I am using samconfig.toml configuration file to pass environment variables. It works fine when I use default environment such as

[default.local_start_api.parameters]
docker_network="host"
parameter_overrides ="TableName=LocalTable Enviroment=local

But when I try to package the sam application for dev using sam package --config-env dev:

[dev.package.parameters]
s3_bucket="mydev-bucket"
template_file="template.yaml"
output_template_file="packaged.yaml"

I get **"Error: Missing option '--s3-bucket'."** even though I am providing the s3-bucket parameter. Also if I change [dev.package.parameters] to [default.package.parameters] and sam package, it works.

Only giving the error in case of custom environment dev.

1 Answers

It works for me. Only difference is that I have the following at top in the samconfig.toml file version=0.1

Related