You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,11 @@
2
2
3
3
ENHANCEMENTS:
4
4
5
-
Fixed import documentation on resources which are supporting import. ([#613](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/613))
5
+
-**netapp-ontap_security_certificate**: added extra parameter to import to support for avoiding duplicate cert names across svms ([#614](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/614))
6
6
7
7
BUG FIXES:
8
8
9
+
- Fixed import documentation on resources which are supporting import. ([#613](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/613))
9
10
-**netapp-ontap_name_services_ldap_resource**: Fixed duplicate Set Element Error with `preferred_ad_servers` ([#615](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/615))
Copy file name to clipboardExpand all lines: docs/resources/security_certificate.md
+35-14Lines changed: 35 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,45 +117,66 @@ EOT
117
117
118
118
## Import
119
119
This resource supports import, which allows you to import existing security certificate into the state of this resource.
120
-
Import require a unique ID composed of the security certificate name, common name, type and connection profile, separated by a comma or security certificate common name, type, and connection profile, separated by a comma.
121
120
122
-
id = `name`,`common_name`,`type`,`cx_profile_name`
121
+
Import supports multiple formats to accommodate different scenarios:
122
+
-**5 parts**: `name`,`common_name`,`type`,`cx_profile_name`,`svm_name` - Use when multiple SVMs have certificates with the same name/common_name
123
+
-**4 parts**: `name`,`common_name`,`type`,`cx_profile_name` - Recommended for ONTAP 9.8 or later
124
+
-**3 parts**: `common_name`,`type`,`cx_profile_name` - Applicable for ONTAP 9.6 or 9.7
123
125
124
126
### Terraform Import
125
127
126
-
For example
128
+
For example
127
129
128
-
Import with certificate name; recommended for ONTAP 9.8 or later
!> The terraform import CLI command can only import resources into the state. Importing via the CLI does not generate configuration. If you want to generate the accompanying configuration for imported resources, use the import block instead.
137
146
138
147
### Terraform Import Block
139
148
This requires Terraform 1.5 or higher, and will auto create the configuration for you
140
149
141
150
First create the block
151
+
152
+
Example with SVM name (for certificates with duplicate names across SVMs):
153
+
```terraform
154
+
import {
155
+
to = netapp-ontap_security_certificate.cert_svm1
156
+
id = "tfsvm_ca_cert1,tfsvm_ca_cert,root_ca,cluster5,carchi-test"
157
+
}
158
+
```
159
+
160
+
Example with certificate name (standard approach):
142
161
```terraform
143
162
import {
144
163
to = netapp-ontap_security_certificate.cert_import
145
164
id = "tfsvm_ca_cert1,tfsvm_ca_cert,root_ca,cluster5"
146
165
}
147
166
```
167
+
148
168
Next run, this will auto create the configuration for you
149
169
```shell
150
170
terraform plan -generate-config-out=generated.tf
151
171
```
172
+
152
173
This will generate a file called generated.tf, which will contain the configuration for the imported resource
153
174
```terraform
154
175
# __generated__ by Terraform
155
176
# Please review these resources and move them into your main configuration files.
156
177
157
-
# __generated__ by Terraform from "tfsvm_ca_cert1,tfsvm_ca_cert,root_ca,cluster5"
fmt.Sprintf("Expected import identifier with format: name,common_name,type,cx_profile_name or common_name,type,cx_profile_name. Got: %q", req.ID),
534
+
fmt.Sprintf("Expected import identifier with format: name,common_name,type,cx_profile_name,svm_name or name,common_name,type,cx_profile_name or common_name,type,cx_profile_name. Got: %q", req.ID),
0 commit comments