Closed AlexStasko closed 11 months ago
Voting for Prioritization
Volunteering to Work on This Issue
Hey @AlexStasko 👋 Thank you for taking the time to raise this! There's a bit about your configuration (particularly around what the hash calculation script looks like) that I'm making some assumptions about, but I think I might have some ideas as to what's causing this. This feels a bit like a Terraform Core issue based on my assumptions, but I'd like to verify my thoughts before we discuss moving the issue over to that repository.
The external
data source has no dependency on the null_resource
data source; exactly the opposite, in fact -- the null_resource
is dependent upon the external
resource. The external resource, however, is calculating a hash value for a file that (as far as I can tell) is being downloaded by the null_resource
. It would seem based on this, that the script in the external
data source might be returning a hash value that's not what you're expecting it to be.
I do feel like I might be missing a key piece of information here that would make this a bit more clear to me. If possible, can you supply debug logs (redacted as needed) so that we can review those as well?
Since we haven't heard back in a while, I'm going to close this issue out. If you're still having troubles, or have future issues with the AWS Provider, please feel free to open a new issue (referencing this one for context as needed).
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.
Terraform Core Version
1.3.6
AWS Provider Version
4.39.0
Affected Resource(s)
Expected Behavior
The value passed to
source_code_hash
should be correctly stored in tf state.Actual Behavior
I'm passing a hash value of the file calculated by the
external
data source to two resources,null_resource
, which downloads file that should be stored in Layer, andaws_lambda_layer_version
, which creates Layer. After firstterraform apply
, I see that the hashes in these two resources are different. When I runterraform plan
a second time, tf calculates thatsource_code_hash
was changed and set the correct value. But in this case,null_resource
will not be triggered as the hash of the file didn't change, andterraform apply
fails with an error that the file doesn't exist.Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
cdk.tf.json:
Steps to Reproduce
Debug Output
No response
Panic Output
No response
Important Factoids
I'm using CDKTF to generate terraform configuration
References
No response
Would you like to implement a fix?
None