aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

Bug: Paths for deploy command flags conflict

Open AlexBurkey opened this issue 4 months ago • 3 comments

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:

  1. Create a config file in your working directory
  2. Create a template file in a different directory
  3. 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

AlexBurkey avatar Oct 16 '24 16:10 AlexBurkey