The root/rotate/ endpoint is a rather pointless endpoint which is identical to issuers/generate/root/, except that the default value for issuer_name is changed to next.
So, I think you might be able to just use vault_pki_secret_backend_root_cert for that part, setting issuer_name to your choice of name for the new CA, to implement that step of that tutorial using Terraform.
Thanks for the tips @maxb. We started to try to implement this with terraform. What we are currently experiencing is the following:
On the first terraform “apply”, we see two issuers for the “vault mount” (I’ve called them “current” and “next”).
However on a subsequent apply (with no changes to the terraform), we see one of the issuers is deleted and we are only left with one. Any further runs just switch between having “current” or “next”.
The output of the terraform apply gives some further clues:
So while we have tried to use vault_pki_secret_backend_root_cert as part of following the root CA rotation guide, it doesn’t appear to support what is required.
Looking for some guidance on next steps.
Thanks
Luke
Here is a minimal terraform example which reproduces the issue for us:
Oh… That’s unfortunate. It appears the full range of multi issuer workflows were not considered when updating terraform-provider-vault when multi-issuer support was added.
It appears a fix to the provider will be needed (it would be good if you could file an issue, if there isn’t one already.)