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

Consistent ID across multiple planning #79

Closed
caruccio opened this issue Sep 14, 2020 · 8 comments · Fixed by #189
Closed

Consistent ID across multiple planning #79

caruccio opened this issue Sep 14, 2020 · 8 comments · Fixed by #189

Comments

@caruccio
Copy link

Terraform Version

terraform -v
Terraform v0.13.2
+ provider registry.terraform.io/hashicorp/tls v2.2.0

Affected Resource(s)

Please list the resources as a list, for example:

  • tls_certificate

Terraform Configuration Files

data "tls_certificate" "oidc_idp" {
  url = "https://oidc.eks.sa-east-1.amazonaws.com/id/<REDACTED>"
}

Expected Behavior

Consistent id across consecutive plans.

Actual Behavior

Resource id changes every plan even if certificates are the same.

...
      ~ id           = "2020-09-14 19:34:14.498463939 +0000 UTC" -> "2020-09-14 19:34:14.722109742 +0000 UTC"
...

Steps to Reproduce

  1. terraform plan .
  2. terraform apply .
  3. terraform plan .

Important Factoids

Obviously, this is the behavior given by this line.
Is this intentional? Could it be something stable, like the certificate's serial number or sha1 fingerprint?

@Fuuzetsu
Copy link

Fuuzetsu commented Oct 5, 2020

The problem is made worse by the fact that the usual lifecycle { ignore_changes = [id] } approach one might want to take does not work:

Error: Unsupported lifecycle block

  on ../modules/main_vpc/eks.tf line 338, in data "tls_certificate" "oidc":
 338:   lifecycle {

Data resources do not have lifecycle settings, so a lifecycle block is not
allowed.

@xenji
Copy link

xenji commented Oct 12, 2020

So, would the sha1_fingerprint be a good ID? It would have the positive side-effect, that it would make a change in this property very visible.

@amirba-mistral
Copy link

Any new info, does somebody found solutions to this problem?

@Z3R6
Copy link

Z3R6 commented Dec 15, 2020

Any updates?

@amirba-mistral
Copy link

Any updates?

I solve this problem with an update of Terraform to version "0.14.2".

@caruccio
Copy link
Author

@amirba-mistral AFAIU this is the line that sets this id: https://github.com/hashicorp/terraform-provider-tls/blob/v3.0.0/internal/provider/data_source_tls_certificate.go#L109

What is the provider version you are using?

@Z3R6
Copy link

Z3R6 commented Dec 15, 2020

Any updates?

I solve this problem with an update of Terraform to version "0.14.2".

I also solved this problem with update Terraform to version "0.14.2".
Thanks!

caruccio added a commit to getupcloud/terraform-provider-tls that referenced this issue Dec 15, 2020
caruccio added a commit to getupcloud/terraform-provider-tls that referenced this issue Dec 15, 2020
@detro detro added this to the v4.0.0 milestone Apr 14, 2022
@detro detro modified the milestones: next.major, 3.4.0 May 5, 2022
detro pushed a commit to iwarapter/terraform-provider-tls that referenced this issue May 5, 2022
@detro detro closed this as completed in #189 May 5, 2022
detro pushed a commit that referenced this issue May 5, 2022
* Closes #139 support parsing certificate content #4

* Using hash of certificates as ID for 'tls_certificate' data source

* Update CHANGELOG.md

* Adding BUGFIX + NOTES to the CHANGELOG as we are now fixing issue #79.

Co-authored-by: Ivan De Marino <ivan.demarino@hashicorp.com>
jackivanov pushed a commit to jackivanov/terraform-provider-tls that referenced this issue Aug 4, 2022
* Closes hashicorp#139 support parsing certificate content hashicorp#4

* Using hash of certificates as ID for 'tls_certificate' data source

* Update CHANGELOG.md

* Adding BUGFIX + NOTES to the CHANGELOG as we are now fixing issue hashicorp#79.

Co-authored-by: Ivan De Marino <ivan.demarino@hashicorp.com>
Copy link

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 May 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
6 participants