Incorrect key_algorithm handling forces delete & replace of ibm_sm_private_certificate on every apply #4978
Labels
service/Resource Management
Issues related to Resource Manager or Resource controller Issues
service/Secrets Manager
Issues related to Secrets Manager
Community Note
Terraform CLI and Terraform IBM Provider Version
Affected Resource(s)
Terraform Configuration Files
The following simple Terraform configures the private certificate engine in Secrets Manager and then creates a certificate for use in the VPC VPN Server service. The thing to note is in the certificate template, I'm specifying a non-default
key_bits
of 4096.Steps to Reproduce
terraform.tfvars
with anibmcloud_api_key
for your account.terraform init
.terraform apply
once.terraform apply
a second time.Expected Behavior
The first apply correctly creates the resources.
The second apply does nothing, as nothing has changed.
Actual Behavior
On the first apply, the template is created with the correct value of
key_bits
:However, Terraform reports the wrong value of
key_algorithm
on the certificate, seemingly ignoring what's in the template:However, the certificate that's created does have the correct key algorithm, which you can verify in the Secrets Manager UI.
On the second apply, Terraform correctly reports the current value of
key_algorithm
as "RSA4096", but again, it thinks it's going to set it to "RSA2048", so it decides it needs to destroy and replace the certificate.The same problem recurs on every subsequent apply, making the certificate unusable.
The text was updated successfully, but these errors were encountered: