-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
tls_cert_request with count forces new resource every time #8764
Comments
Here is a sample Terraform file to replicate the problem.
The only way to work around it is to pass
|
I made a quick local build of Terraform that doesn't hash the
Extracting these in a readable way, we have the following two cert requests:
These two are different, so the diff is warranted. Of course, the PEM encoding makes it hard to see what exactly is going on here, so we can decode it:
Here's the diff:
So the part that changed here was the signature on the CSR. This makes sense, since a signature contains a randomly-generated nonce. Seems like I was a bit over-eager to data-source-ize this resource, since I failed to consider that it had a random element embedded in it. In Terraform our pattern is to treat random numbers as a resource so that we can hold on to them in the state after they have been generated. I think the fix here would be to turn I'll accept full responsibility for this oversight; in my vigor to convert all of the "read only" things to data sources for the 0.7 release I didn't properly consider the implications of converting this one. |
@apparentlymart Thanks for looking into this. Your proposed solution makes sense 👍 I will revert back to using resources for now and ignore the deprecation warnings and then once |
@apparentlymart Btw, this is still an issue. It shouldn't be closed as it still happens in the latest dev version. |
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. |
Hi there,
I am building a CoreOS cluster with Terraform and I am creating a locally signed certificate for each cluster node. Something along the lines:
Then I use the generated locally signed certificate as part of user data to spin up cluster nodes.
The problem is, Terraform forces the instances to be recreated every time without any changes.
It thinks the
tls_cert_request
has changed although it should not have.Terraform Version
Affected Resource(s)
Debug Output
See bellow. This happens every single time and forces new resources.
The text was updated successfully, but these errors were encountered: