Skip to content
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

Applying any change other than private on ssl_server_key breaks the private key #32

Open
stroebs opened this issue Jul 24, 2024 · 0 comments

Comments

@stroebs
Copy link

stroebs commented Jul 24, 2024

There is an issue in the handling of the hashed private value in the ssl_server_key resource.

The API response from the endpoint /api/tm/8.3/config/active/ssl/server_keys/{Id} returns a base64-encoded hashed key. Since there is a DiffSuppressFunc set which swallows the diff (https://github.com/pulse-vadc/terraform-provider-vtm/blob/master/8.3/resource_ssl_server_key.go#L50), and the object is fetched new from the API on Update (https://github.com/pulse-vadc/terraform-provider-vtm/blob/master/8.3/resource_ssl_server_key.go#L120), the private key is always sent back to the API as a base64-encoded hashed key. This key is persisted to the configuration and results in the error Unknown key type on the vTM.

Applying terraform again fixes this problem, because the file hash has changed in the API and Terraform detects this as a diff correctly.

Steps to reproduce:

  1. Create a ssl_server_key resource
  2. Update the note value
  3. Observe the Unknown key type error in the vTM
  4. Plan again, and observe the private attribute needs to be updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant