Skip to content

[Enhancement]: Support SVM-specific import for netapp-ontap_security_certificate for avoiding duplicate names #614

@suhasbshekar

Description

@suhasbshekar

Description

[Enhancement]: Support SVM-specific import for netapp-ontap_security_certificate with duplicate names

Description

I am requesting an enhancement to the netapp-ontap_security_certificate resource import functionality to support importing certificates when multiple SVMs have certificates with the same name and common_name.

Currently, the import function only supports these formats:

  • name,common_name,type,cx_profile_name (4 parts)
  • common_name,type,cx_profile_name (3 parts)

This creates a problem when managing ca certificates across multiple SVMs that use the same certificate name and common name (This is the case for our standard certificates deployed across multiple SVMs). The current import logic cannot distinguish between these certificates, and because netapp treats these certificates seperately, it is not possible to import them at this time.

Requested Resource(s) and/or Data Source(s)

Enhancement to existing netapp-ontap_security_certificate resource import functionality

Potential Terraform Configuration

Current Problem

# These certificates exist on different SVMs but have same name/common_name
# Currently cannot be imported due to ambiguity. Terraform syntax used for illustrative purpose.

# SVM: carchi-test
resource "netapp-ontap_security_certificate" "cert_svm1" {
  cx_profile_name = "cluster5"
  svm_name        = "carchi-test"
  name            = "tfsvm_ca_cert1"
  common_name     = "tfsvm_ca_cert"
  type            = "root_ca"
  # ... other attributes
}

# SVM: carchi-prod  
resource "netapp-ontap_security_certificate" "cert_svm2" {
  cx_profile_name = "cluster5"
  svm_name        = "carchi-prod"
  name            = "tfsvm_ca_cert1"  # Same name as above
  common_name     = "tfsvm_ca_cert"   # Same common_name as above
  type            = "root_ca"
  # ... other attributes
}

Proposed Solution; Add SVM to import string

Create one more import format with 5 fields:

id = name,common_name,type,cx_profile_name,svm_name

# Another import format: id=name,common_name,type,cx_profile_name,svm_name
terraform import netapp-ontap_security_certificate.cert_svm1 tfsvm_ca_cert1,tfsvm_ca_cert,server_ca,cluster5,carchi-test

This way there isn't a failure when importing the security certificate.

Affected Resource(s) and/or Data Source(s)

netapp-ontap_security_certificate

Potential Terraform Configuration

id = name,common_name,type,cx_profile_name,svm_name

References

No response

Would you like to implement a fix?

None

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

2.5.0

Relationships

None yet

Development

No branches or pull requests

Issue actions