-
Notifications
You must be signed in to change notification settings - Fork 10
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
Sample for KeyVault #1
Comments
Interesting, I'm trying to see how I can combine the use of Key Vault, Let's Encrypt and Terraform. |
Well, I have a first step working on this branch. |
Do you also have the problem of KV wanting to create a new certificate at every apply? |
I've created a repro of my setup: https://github.com/Kralizek/AzureKeyVaultLetsEncrypt Funny enough, I don't get the issue with the KV certificate being created on each apply. 😔 |
Not really, at least not from what I remember. It depends on the provider, for the acme provider the certificate is renewed during an apply if the certificate is closed to expiration. So as long as you're applying your configuration regularly, the certificate will be renewed, but not on each apply. Actually I was asked a question in the comments of my blog post, and replied with a link to this paragraph in the acme provider docs. |
I'm having the issue when running apply back to back. |
Nice, the KeyVault.Acmebot repo is a good find ! From what I see it spins Durable Azure Functions to handle certificate renewal in a Key Vault (that you could bring or letting the provider create for you). It could be done by the Key Vault itself if the certificate is generated by the vault and not imported in it, that's what I tried to achieve with the CSR but it's tricky with Terraform (it can be done using Azure CLI check this blog post. Also I see you are using a fork of the acme Terraform provider I'm using, but it still uses the same attribute ( |
I realized I was using a fork when collecting the links to add in the readme. I'll try switching to the parent provider and see if the issue is solved in my concrete application. Anyway it's interesting that the apply problem doesn't manifest in this repro. |
I have just run a bunch of applies back to back and no change is done by Terraform, and the thumbprint in the App Service certificate doesn't change so I can confirm I don't encounter this issue :-/ |
Thanks :) |
I eventually found out where the double apply problem was coming from and fixed it by having the KV in the same subscription of where the certificate is used. |
Would it be possible to have a sample where the certificate is imported into KeyVault?
Right now I'm getting the certificate added every time I run
terraform apply
The text was updated successfully, but these errors were encountered: