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

40 enhancement netapp ontap storage snapshot policy need to support import #105

Conversation

wenjun666
Copy link
Contributor

No description provided.

### Terraform Import
For example
```shell
terraform import netapp-ontap_storage_snapshot_policy_resource.example exp1,svm1,cluster4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"exp1" might confuse people. Maybe use something like "policy1" or "snp_policy1"

```terraform
import {
to = netapp-ontap_storage_snapshot_policy_resource.exp_import
id = "exp1,svm1,cluster4"
Copy link
Contributor

@chuyich chuyich Dec 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as here "exp1" seems not really represent as the snapshot policy name (line 107 & 108)

```terraform
# __generated__ by Terraform
# Please review these resources and move them into your main configuration files.
# __generated__ by Terraform from "exp1,svm1,cluster4"
Copy link
Contributor

@chuyich chuyich Dec 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as these lines 119, 120, 122

ImportState: true,
ImportStateId: fmt.Sprintf("%s,%s,%s", "tfimportpolicy", "automation", "cluster4"),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("netapp-ontap_protocols_nfs_export_policy_resource.example", "name", "tfimportpolicy"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the resource address is not about storage policy

Copy link
Contributor

@chuyich chuyich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please check the comments and update them.

Copy link
Contributor

@chuyich chuyich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more small change.

First create the block
```terraform
import {
to = netapp-ontap_storage_snapshot_policy_resource.exp_import
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not match the example in line 120 (exp_import vs policy1_import)

@carchi8py carchi8py merged commit 3ce2b91 into integration/main Dec 19, 2023
7 checks passed
@carchi8py carchi8py deleted the 40-enhancement-netapp-ontap_storage_snapshot_policy-need-to-support-import branch December 19, 2023 18:42
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

Successfully merging this pull request may close these issues.

[Enhancement]: netapp-ontap_storage_snapshot_policy need to support import
3 participants