You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in our use case, started with locally building packages but quickly had to switch away from that to building zip packages via CI/CD of the Lambda stuff we want to deploy. Hence, we use the s3_existing_package variable to reference that built packages. However, we came across the issue that the package will not be redeployed, even if there are modifications to it. To solve this, the lambda resources offer the source_code_hash attribute that is intended to detect package changes and deploy if necessary. It would be great if there simply could be a variable that, if it is set, will be simply passed to respective layer and function resources. I would make a proposal as before but i do not completely understand the if statement composition and dont want to ruin something there. But basically it should be some kind of if statement at the top level like this:
You have a couple of ways of achieving this already.
The first one is to make sure that the zip archive is actually updating when there are changes inside, or by setting hash_extra = uuid(), for example. See this.
Also, you can download the package locally from S3 and then it should redeploy if content changes. See this.
source_code_hash is too low-level setting for controlling redeployment, so I would not do changes to it in the module.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Hello again :)
in our use case, started with locally building packages but quickly had to switch away from that to building zip packages via CI/CD of the Lambda stuff we want to deploy. Hence, we use the s3_existing_package variable to reference that built packages. However, we came across the issue that the package will not be redeployed, even if there are modifications to it. To solve this, the lambda resources offer the source_code_hash attribute that is intended to detect package changes and deploy if necessary. It would be great if there simply could be a variable that, if it is set, will be simply passed to respective layer and function resources. I would make a proposal as before but i do not completely understand the if statement composition and dont want to ruin something there. But basically it should be some kind of if statement at the top level like this:
source_code_hash = var.source_code_hash != "" ? var.source_code_hash : other_stuff_that_is_currently_in_the_statement
What do you say?
Many thanks
The text was updated successfully, but these errors were encountered: