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

Bug: option --base-dir does not work

Open stationname opened this issue 1 year ago • 1 comments

Description:

--base-dir does not apply the given directory to relative path in --config-file

Steps to reproduce:

(1) project structure:

/ 
    my_lambda_project1
          build_and_deploy
                samconfig.toml
                template.yaml
    my_lambda_project2
          ...

(2) move to root directory (/)

(3) run sam build --base-dir "./my_lambda_project1" --config-file "./build_and_deploy/samconfig.toml"

Observed result:

2024-04-12 16:39:57,170 | Config file ./build_and_deploy/samconfig.toml does not exist or could not be   
read!                                                                                                         
Error: Config file ./build_and_deploy/samconfig.toml does not exist or could not be read!

Expected result:

sam starts building using the samconfig.toml file

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  • OS: Mac OS
  • sam version: 1.115.0
  • aws region: irrelevant for this use case.

sam --info:

{
  "version": "1.115.0",
  "system": {
    "python": "3.12.2",
    "os": "macOS-14.3.1-arm64-arm-64bit"
  },
  "additional_dependencies": {
    "docker_engine": "20.10.16",
    "aws_cdk": "2.61.1 (build d319d9c)",
    "terraform": "Not available"
  },
  "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"
  ]
}

stationname avatar Apr 12 '24 07:04 stationname

Hi, thanks for bringing up the issue. Can you try running the build again with the command with it like this and let me know your result then? sam build --base-dir "./my_lambda_project1" --config-file "build_and_deploy/samconfig.toml".

jysheng123 avatar Apr 16 '24 16:04 jysheng123

Closing due to inactivity. If the issue persists, please open a new issue.

mildaniel avatar Aug 22 '24 16:08 mildaniel

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar Aug 22 '24 16:08 github-actions[bot]