Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: sam sync does not have --container-env-var-file parameter #6427

Closed
zyrorl opened this issue Dec 9, 2023 · 6 comments
Closed

Bug: sam sync does not have --container-env-var-file parameter #6427

zyrorl opened this issue Dec 9, 2023 · 6 comments
Labels
area/sync sam sync command contributors/good-first-issue Good first issue for a contributor type/feature Feature request

Comments

@zyrorl
Copy link

zyrorl commented Dec 9, 2023

Description:

It appears that sam sync doesn't support passing in of --container-env-var-file when using the --use-container flag.

This means that when building the code it's missing any environment variables needed to compile the project.

Steps to reproduce:

Run sam sync --use-container --container-env-var-file container.env.json. Variable files are not respected as per sam build or other commands.

Observed result:

Container builds that require env vars have those vars unset.

Expected result:

Environment variables are passed into container as per sam build

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

{
  "version": "1.104.0",
  "system": {
    "python": "3.11.3",
    "os": "Linux-5.10.201-191.748.amzn2.x86_64-x86_64-with-glibc2.26"
  },
  "additional_dependencies": {
    "docker_engine": "20.10.25",
    "aws_cdk": "2.114.1 (build 02bbb1d)",
    "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"
  ]
}
@zyrorl zyrorl added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Dec 9, 2023
@jysheng123 jysheng123 added area/sync sam sync command contributors/good-first-issue Good first issue for a contributor type/feature Feature request and removed stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Dec 11, 2023
@jysheng123
Copy link
Contributor

Hi, thanks for bringing up the issue. It looks like we only support --container-env-file option on sam build currently, but this looks like a quick feature request to implement. I will let the team know about it to see about putting it in the future.

@zyrorl
Copy link
Author

zyrorl commented Feb 1, 2024

any updates on this?

@nitintecg
Copy link
Contributor

nitintecg commented Feb 25, 2024

@jysheng123 i would like to work on this. But, I'm facing one issue while writing unit tests for same.
I tried searching in CONTRIBUTING.md file but not found. Can you share me specific doc/contributing reference guide ?
Thanks

@hnnasit
Copy link
Contributor

hnnasit commented Apr 19, 2024

Hi @nitintecg, if you are interested to contribute feel free to open a PR and our team would be happy to review and assist with unit tests. I don't recall if we have specific guidelines on writing unit tests, but you can follow the existing unit tests to get some idea.

@hnnasit
Copy link
Contributor

hnnasit commented Jun 9, 2024

Closing as the PR has been merged and released.

@hnnasit hnnasit closed this as completed Jun 9, 2024
Copy link
Contributor

github-actions bot commented Jun 9, 2024

⚠️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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sync sam sync command contributors/good-first-issue Good first issue for a contributor type/feature Feature request
Projects
None yet
Development

No branches or pull requests

4 participants