Skip to content

Commit 29bafbd

Browse files
authored
Merge pull request #617 from NetApp/613-docs-import-not-documented-in-resources
fixed import documentation
2 parents e5e0d3a + 3c81839 commit 29bafbd

File tree

8 files changed

+365
-1
lines changed

8 files changed

+365
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# 2.5.0 (2026-**-**)
22

3+
ENHANCEMENTS:
4+
5+
Fixed import documentation on resources which are supporting import. ([#613](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/613))
6+
37
BUG FIXES:
48

59
- **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))

docs/resources/cifs_local_user.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,53 @@ resource "netapp-ontap_cifs_local_user" "example" {
6565
Read-Only:
6666

6767
- `name` (String) CifsLocalUser membership name
68+
69+
## Import
70+
71+
This resource supports import, which allows you to import existing CIFS local user into the state of this resource.
72+
Import require a unique ID composed of the user name, SVM name, and connection profile, separated by commas.
73+
74+
id = `name`,`svm_name`,`cx_profile_name`
75+
76+
### Terraform Import
77+
78+
For example
79+
80+
```shell
81+
terraform import netapp-ontap_cifs_local_user.example localuser1,svm1,cluster4
82+
```
83+
84+
!> 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.
85+
86+
### Terraform Import Block
87+
88+
This requires Terraform 1.5 or higher, and will auto create the configuration for you
89+
90+
First create the block
91+
92+
```terraform
93+
import {
94+
to = netapp-ontap_cifs_local_user.user_import
95+
id = "localuser1,svm1,cluster4"
96+
}
97+
```
98+
99+
Next run, this will auto create the configuration for you
100+
101+
```shell
102+
terraform plan -generate-config-out=generated.tf
103+
```
104+
105+
This will generate a file called generated.tf, which will contain the configuration for the imported resource
106+
107+
```terraform
108+
# __generated__ by Terraform
109+
# Please review these resources and move them into your main configuration files.
110+
# __generated__ by Terraform from "localuser1,svm1,cluster4"
111+
resource "netapp-ontap_cifs_local_user" "user_import" {
112+
cx_profile_name = "cluster4"
113+
name = "localuser1"
114+
svm_name = "svm1"
115+
...
116+
}
117+
```

docs/resources/cifs_service.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,58 @@ Optional:
136136
- `try_ldap_channel_binding` (Boolean) Specifies whether or not channel binding is attempted in the case of TLS/LDAPS (9.10)
137137
- `use_ldaps` (Boolean) Specifies whether or not to use use LDAPS for secure Active Directory LDAP connections by using the TLS/SSL protocols (9.10)
138138
- `use_start_tls` (Boolean) Specifies whether or not to use SSL/TLS for allowing secure LDAP communication with Active Directory LDAP servers (9.10)
139+
140+
## Import
141+
142+
This resource supports import, which allows you to import existing CIFS service into the state of this resource.
143+
Import require a unique ID composed of the service name, SVM name, connection profile, AD domain user, and AD domain password, separated by commas.
144+
145+
id = `name`,`svm_name`,`cx_profile_name`,`ad_domain.user`,`ad_domain.password`
146+
147+
### Terraform Import
148+
149+
For example
150+
151+
```shell
152+
terraform import netapp-ontap_cifs_service.example tftestcifs,testSVM,clustercifs,administrator,password
153+
```
154+
155+
!> 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.
156+
157+
### Terraform Import Block
158+
159+
This requires Terraform 1.5 or higher, and will auto create the configuration for you
160+
161+
First create the block
162+
163+
```terraform
164+
import {
165+
to = netapp-ontap_cifs_service.cifs_import
166+
id = "tftestcifs,testSVM,clustercifs,administrator,password"
167+
}
168+
```
169+
170+
Next run, this will auto create the configuration for you
171+
172+
```shell
173+
terraform plan -generate-config-out=generated.tf
174+
```
175+
176+
This will generate a file called generated.tf, which will contain the configuration for the imported resource
177+
178+
```terraform
179+
# __generated__ by Terraform
180+
# Please review these resources and move them into your main configuration files.
181+
# __generated__ by Terraform from "tftestcifs,testSVM,clustercifs,administrator,password"
182+
resource "netapp-ontap_cifs_service" "cifs_import" {
183+
cx_profile_name = "clustercifs"
184+
name = "tftestcifs"
185+
svm_name = "testSVM"
186+
ad_domain = {
187+
user = "administrator"
188+
password = "password"
189+
...
190+
}
191+
...
192+
}
193+
```

docs/resources/cifs_share.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,54 @@ Optional:
9898
- `permission` (String) Specifies the access rights that a user or group has on the defined CIFS Share.
9999
- `type` (String) string Specifies the type of the user or group to add to the access control list of a CIFS share.
100100
- `user_or_group` (String) Specifies the user or group name to add to the access control list of a CIFS share.
101+
102+
## Import
103+
104+
This resource supports import, which allows you to import existing CIFS share into the state of this resource.
105+
Import require a unique ID composed of the share name, SVM name, and connection profile, separated by commas.
106+
107+
id = `name`,`svm_name`,`cx_profile_name`
108+
109+
### Terraform Import
110+
111+
For example
112+
113+
```shell
114+
terraform import netapp-ontap_cifs_share.example share1,svm1,cluster4
115+
```
116+
117+
!> 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.
118+
119+
### Terraform Import Block
120+
121+
This requires Terraform 1.5 or higher, and will auto create the configuration for you
122+
123+
First create the block
124+
125+
```terraform
126+
import {
127+
to = netapp-ontap_cifs_share.share_import
128+
id = "share1,svm1,cluster4"
129+
}
130+
```
131+
132+
Next run, this will auto create the configuration for you
133+
134+
```shell
135+
terraform plan -generate-config-out=generated.tf
136+
```
137+
138+
This will generate a file called generated.tf, which will contain the configuration for the imported resource
139+
140+
```terraform
141+
# __generated__ by Terraform
142+
# Please review these resources and move them into your main configuration files.
143+
# __generated__ by Terraform from "share1,svm1,cluster4"
144+
resource "netapp-ontap_cifs_share" "share_import" {
145+
cx_profile_name = "cluster4"
146+
name = "share1"
147+
svm_name = "svm1"
148+
path = "/vol1"
149+
...
150+
}
151+
```

docs/resources/iscsi_service.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,53 @@ Optional:
5353
Read-Only:
5454

5555
- `name` (String) iSCSI target name of the iSCSI service
56+
57+
## Import
58+
59+
This resource supports import, which allows you to import existing iSCSI service into the state of this resource.
60+
Import require a unique ID composed of the SVM name and connection profile, separated by a comma.
61+
62+
id = `svm_name`,`cx_profile_name`
63+
64+
### Terraform Import
65+
66+
For example
67+
68+
```shell
69+
terraform import netapp-ontap_iscsi_service.example svm1,cluster4
70+
```
71+
72+
!> 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.
73+
74+
### Terraform Import Block
75+
76+
This requires Terraform 1.5 or higher, and will auto create the configuration for you
77+
78+
First create the block
79+
80+
```terraform
81+
import {
82+
to = netapp-ontap_iscsi_service.iscsi_import
83+
id = "svm1,cluster4"
84+
}
85+
```
86+
87+
Next run, this will auto create the configuration for you
88+
89+
```shell
90+
terraform plan -generate-config-out=generated.tf
91+
```
92+
93+
This will generate a file called generated.tf, which will contain the configuration for the imported resource
94+
95+
```terraform
96+
# __generated__ by Terraform
97+
# Please review these resources and move them into your main configuration files.
98+
# __generated__ by Terraform from "svm1,cluster4"
99+
resource "netapp-ontap_iscsi_service" "iscsi_import" {
100+
cx_profile_name = "cluster4"
101+
svm_name = "svm1"
102+
enabled = true
103+
...
104+
}
105+
```

docs/resources/name_services_ldap.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,53 @@ resource "netapp-ontap_name_services_ldap" "name_services_ldap_examp2" {
8282
### Read-Only
8383

8484
- `id` (String) NameServicesLDAP ID
85+
86+
## Import
87+
88+
This resource supports import, which allows you to import existing LDAP configuration into the state of this resource.
89+
Import require a unique ID composed of the SVM name and connection profile, separated by a comma.
90+
91+
id = `svm_name`,`cx_profile_name`
92+
93+
### Terraform Import
94+
95+
For example
96+
97+
```shell
98+
terraform import netapp-ontap_name_services_ldap.example testsvm1,cluster4
99+
```
100+
101+
!> 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.
102+
103+
### Terraform Import Block
104+
105+
This requires Terraform 1.5 or higher, and will auto create the configuration for you
106+
107+
First create the block
108+
109+
```terraform
110+
import {
111+
to = netapp-ontap_name_services_ldap.ldap_import
112+
id = "testsvm1,cluster4"
113+
}
114+
```
115+
116+
Next run, this will auto create the configuration for you
117+
118+
```shell
119+
terraform plan -generate-config-out=generated.tf
120+
```
121+
122+
This will generate a file called generated.tf, which will contain the configuration for the imported resource
123+
124+
```terraform
125+
# __generated__ by Terraform
126+
# Please review these resources and move them into your main configuration files.
127+
# __generated__ by Terraform from "testsvm1,cluster4"
128+
resource "netapp-ontap_name_services_ldap" "ldap_import" {
129+
cx_profile_name = "cluster4"
130+
svm_name = "testsvm1"
131+
servers = ["ldap1.example.com", "ldap2.example.com"]
132+
...
133+
}
134+
```

docs/resources/network_ip_route.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,50 @@ Optional:
6767

6868
## Import
6969

70-
Import is currently not support for this Resource.
70+
This resource supports import, which allows you to import existing network IP route into the state of this resource.
71+
Import require a unique ID composed of the SVM name, gateway, and connection profile, separated by a comma.
72+
73+
id = `svm_name`,`gateway`,`cx_profile_name`
74+
75+
### Terraform Import
76+
77+
For example
78+
79+
```shell
80+
terraform import netapp-ontap_network_ip_route.example svm1,192.168.1.1,cluster4
81+
```
82+
83+
!> 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.
84+
85+
### Terraform Import Block
86+
87+
This requires Terraform 1.5 or higher, and will auto create the configuration for you
88+
89+
First create the block
90+
91+
```terraform
92+
import {
93+
to = netapp-ontap_network_ip_route.route_import
94+
id = "svm1,192.168.1.1,cluster4"
95+
}
96+
```
97+
98+
Next run, this will auto create the configuration for you
99+
100+
```shell
101+
terraform plan -generate-config-out=generated.tf
102+
```
103+
104+
This will generate a file called generated.tf, which will contain the configuration for the imported resource
105+
106+
```terraform
107+
# __generated__ by Terraform
108+
# Please review these resources and move them into your main configuration files.
109+
# __generated__ by Terraform from "svm1,192.168.1.1,cluster4"
110+
resource "netapp-ontap_network_ip_route" "route_import" {
111+
cx_profile_name = "cluster4"
112+
svm_name = "svm1"
113+
gateway = "192.168.1.1"
114+
...
115+
}
116+
```

docs/resources/s3_policy.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,61 @@ resource "netapp-ontap_s3_policy" "protocols_s3_policy" {
8989
Read-Only:
9090

9191
- `index` (Number) Statement index
92+
93+
## Import
94+
95+
This resource supports import, which allows you to import existing S3 policy into the state of this resource.
96+
Import require a unique ID composed of the policy name, SVM name, and connection profile, separated by commas.
97+
98+
id = `name`,`svm_name`,`cx_profile_name`
99+
100+
### Terraform Import
101+
102+
For example
103+
104+
```shell
105+
terraform import netapp-ontap_s3_policy.example policy1,svm1,cluster4
106+
```
107+
108+
!> 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.
109+
110+
### Terraform Import Block
111+
112+
This requires Terraform 1.5 or higher, and will auto create the configuration for you
113+
114+
First create the block
115+
116+
```terraform
117+
import {
118+
to = netapp-ontap_s3_policy.policy_import
119+
id = "policy1,svm1,cluster4"
120+
}
121+
```
122+
123+
Next run, this will auto create the configuration for you
124+
125+
```shell
126+
terraform plan -generate-config-out=generated.tf
127+
```
128+
129+
This will generate a file called generated.tf, which will contain the configuration for the imported resource
130+
131+
```terraform
132+
# __generated__ by Terraform
133+
# Please review these resources and move them into your main configuration files.
134+
# __generated__ by Terraform from "policy1,svm1,cluster4"
135+
resource "netapp-ontap_s3_policy" "policy_import" {
136+
cx_profile_name = "cluster4"
137+
name = "policy1"
138+
svm_name = "svm1"
139+
statements = [
140+
{
141+
sid = "statement1"
142+
effect = "allow"
143+
actions = ["GetObject"]
144+
resources = ["bucket1/*"]
145+
}
146+
]
147+
...
148+
}
149+
```

0 commit comments

Comments
 (0)