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: Changing parameters-override when running sam sync does not force update #6172

Closed
GeeWee opened this issue Oct 31, 2023 · 3 comments
Closed
Labels
area/sync sam sync command stage/waiting-for-release Fix has been merged to develop and is waiting for a release type/bug

Comments

@GeeWee
Copy link

GeeWee commented Oct 31, 2023

Description:

When I run e.g. sam sync --watch --parameter-overrides "MYVAR=foo1" the environment variables do not update in my lambda.

However if I edit template.yml, the variables are updated

Steps to reproduce:

Run
sam sync --watch --parameter-overrides "MYVAR=foo1"
Have the parameter passed to an environment variable.
See the env variable is foo1

Without touching anything, run:
sam sync --watch --parameter-overrides "MYVAR=foo2"
Run the lambda, see the value is still foo1

Now touch the file, and either re-run the command or leave it running, re-execute the lambda, and see the value is now properly changed.

Cannot provide debug logs as I hit the github comment length limit.

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

{
  "version": "1.99.0",
  "system": {
    "python": "3.8.13",
    "os": "macOS-14.0-arm64-arm-64bit"
  },
  "additional_dependencies": {
    "docker_engine": "Not available",
    "aws_cdk": "Not available",
    "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"
  ]
}
@GeeWee GeeWee added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Oct 31, 2023
@moelasmar
Copy link
Contributor

Thanks @GeeWee for raising this issue. I will investigate it and update you.

@moelasmar
Copy link
Contributor

I verified this issue, the root cause of this problem is in SAM CLI logic, we compared the local template file, and the deployed stack template to decide if we should update the infra or not (check this snippet), and we did not include the stack parameters in the comparison, I need to check if this was decided or we just missed it.

For now to resolve this problem you can add --no-skip-deploy-sync the flag to the sam sync command to force updating the infrastructure.

@moelasmar moelasmar added area/sync sam sync command type/bug labels Nov 3, 2023
@lucashuy lucashuy removed the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Nov 28, 2023
@bentvelj bentvelj added the stage/waiting-for-release Fix has been merged to develop and is waiting for a release label Dec 12, 2023
Copy link
Contributor

github-actions bot commented Jan 4, 2024

Patch is released in v1.106.0. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sync sam sync command stage/waiting-for-release Fix has been merged to develop and is waiting for a release type/bug
Projects
None yet
Development

No branches or pull requests

4 participants