vancluever / terraform-provider-acme-old

ACME (Let's Encrypt) Support for Terraform
Other
207 stars 26 forks source link

resource/certificate: ID should change on renewal #52

Closed vancluever closed 6 years ago

vancluever commented 6 years ago

In #48 we restored the URL attributes to both resources and ensured that ID modification was de-coupled from the resource lifecycle aside from create.

I would like to modify this for acme_certificate as technically, in lego, a renewal is an entirely new certificate. I don't know if this is an ACME or lego shortcoming, but it doesn't necessarily matter as we mainly care about how it's currently implemented in the client.

As such, we should do a d.SetId with the new certificate URL upon renewal. We can also toss a check into TestAccACMECertificate_forceRenewal to make sure the ID is stable upon both creation and renewal.