Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Enable simple passing of source_code_hash attribute to module #59

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

Closed
Zyntogz opened this issue Sep 21, 2020 · 3 comments
Closed

Enable simple passing of source_code_hash attribute to module #59

Zyntogz opened this issue Sep 21, 2020 · 3 comments

Comments

@Zyntogz
Copy link

Zyntogz commented Sep 21, 2020

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

@antonbabenko
Copy link
Member

Hi @Zyntogz !

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.

@antonbabenko
Copy link
Member

This has been fixed in the recent releases. Please upgrade the version of the module to the latest and see details in #175 and #181.

I am going to close this issue now as fixed, but please open a new one if there is something else.

@github-actions
Copy link

github-actions bot commented Nov 9, 2022

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants