aws-sam-cli
aws-sam-cli copied to clipboard
Bug: Paths for deploy command flags conflict
Description:
I'm attempting to specify both a --config-file
and --template-file
in different directories. Both files exist, but if the template file is in a different directory, that seems to become the working directory.
Working commands:
sam deploy --config-file samconfig.foo.toml --template-file foo-template.yaml
sam deploy --config-file ../../samconfig.foo.toml --template-file path/to/foo-template.yaml
Command fails:
sam deploy --config-file samconfig.foo.toml --template-file path/to/foo-template.yaml
Error message: Error: Config file samconfig.foo.toml does not exist or could not be read!
Steps to reproduce:
- Create a config file in your working directory
- Create a template file in a different directory
- Attempt to run a
sam deploy
command specifying the locations of both
Observed result:
2024-10-16 10:26:28,535 | Config file samconfig.foo.toml does not exist or could not be read!
Error: Config file samconfig.foo.toml does not exist or could not be read!
Expected result:
The deploy is able advance with the proper configs. I was unable to find any info in the docs saying that specifying the --template-file
command would change the working directory.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --info
{
"version": "1.98.0",
"system": {
"python": "3.8.13",
"os": "macOS-14.6.1-arm64-arm-64bit"
},
"additional_dependencies": {
"docker_engine": "Not available",
"aws_cdk": "Not available",
"terraform": "1.9.7"
},
"available_beta_feature_env_vars": [
"SAM_CLI_BETA_FEATURES",
"SAM_CLI_BETA_BUILD_PERFORMANCE",
"SAM_CLI_BETA_TERRAFORM_SUPPORT",
"SAM_CLI_BETA_RUST_CARGO_LAMBDA"
]
}
Add --debug flag to command you are running