This blocks creates a new RSA key-pair.
resource "tls_private_key" "rsa" {
count = var.generate_rsa_key ? 1 : 0
algorithm = "RSA"
rsa_bits = 4096
}
I would like this resource to recreate every 90 days to have a RSA key rotated for compliance reason.
I have tried triggers {}, keepers{}, lifecycle{} with time provider, seems these blocks aren’t supported inside tls_private_key resource.
sample Error for triggers
Error: Unsupported argument
│ on generate_rsa.tf line 7, in resource "tls_private_key" "rsa":
│ 7: triggers = {
│ An argument named "triggers" is not expected here.
Is there any other way to auto-rotate RSA key based on time using Terraform? Excluding - explicit taint