-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #234 from NetApp/136-new-resource-storagequotarules
new resource quota rules
- Loading branch information
Showing
13 changed files
with
917 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "netapp-ontap_quota_rules Resource - terraform-provider-netapp-ontap" | ||
subcategory: "Storage" | ||
description: |- | ||
StorageQuotaRules resource | ||
--- | ||
|
||
# Resource Quota Rules | ||
|
||
Create/Modify/Delete a quota rules resource | ||
|
||
### Related ONTAP commands | ||
```commandline | ||
* quota policy rule create | ||
* quota policy rule modify | ||
* quota policy rule delete | ||
``` | ||
|
||
## Supported Platforms | ||
* On-perm ONTAP system 9.6 or higher | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "netapp-ontap_quota_rules" "storage_quota_rules" { | ||
# required to know which system to interface with | ||
cx_profile_name = "cluster2" | ||
volume = { | ||
name = "lunTest" | ||
} | ||
svm = { | ||
name = "test" | ||
} | ||
type = "tree" | ||
qtree = { | ||
name = "test" | ||
} | ||
files = { | ||
hard_limit = 100 | ||
soft_limit = 70 | ||
} | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `cx_profile_name` (String) Connection profile name | ||
- `qtree` (Attributes) Qtree for which to create the rule. For default tree rules, the qtree name must be specified as "" (see [below for nested schema](#nestedatt--qtree)) | ||
- `svm` (Attributes) Existing SVM in which to create the qtree (see [below for nested schema](#nestedatt--svm)) | ||
- `type` (String) Quota type for the rule. This type can be user, group, or tree | ||
- `volume` (Attributes) Existing volume in which to create the qtree (see [below for nested schema](#nestedatt--volume)) | ||
|
||
### Optional | ||
|
||
- `files` (Attributes) (see [below for nested schema](#nestedatt--files)) | ||
- `group` (Attributes) If the quota type is group, this property takes the group name. For default group quota rules, the group name must be specified as "" (see [below for nested schema](#nestedatt--group)) | ||
- `users` (Attributes Set) If the quota type is user, this property takes the user name. For default user quota rules, the user name must be specified as "" (see [below for nested schema](#nestedatt--users)) | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
|
||
<a id="nestedatt--qtree"></a> | ||
### Nested Schema for `qtree` | ||
|
||
Required: | ||
|
||
- `name` (String) name of the qtree | ||
|
||
|
||
<a id="nestedatt--svm"></a> | ||
### Nested Schema for `svm` | ||
|
||
Required: | ||
|
||
- `name` (String) name of the SVM | ||
|
||
|
||
<a id="nestedatt--volume"></a> | ||
### Nested Schema for `volume` | ||
|
||
Required: | ||
|
||
- `name` (String) name of the volume | ||
|
||
|
||
<a id="nestedatt--files"></a> | ||
### Nested Schema for `files` | ||
|
||
Optional: | ||
|
||
- `hard_limit` (Number) Specifies the hard limit for files | ||
- `soft_limit` (Number) Specifies the soft limit for files | ||
|
||
|
||
<a id="nestedatt--group"></a> | ||
### Nested Schema for `group` | ||
|
||
Required: | ||
|
||
- `name` (String) name of the group | ||
|
||
|
||
<a id="nestedatt--users"></a> | ||
### Nested Schema for `users` | ||
|
||
Optional: | ||
|
||
- `name` (String) name of the user | ||
|
||
## Import | ||
This Resource supports import, which allows you to import existing quota rules into the state of this resoruce. | ||
Import require a unique ID composed of the volume name, svm name, type, qtree and cx_profile_name, separated by a comma. | ||
|
||
id = `name`,`volume_name`, `svm_name`, `cx_profile_name` | ||
|
||
### Terraform Import | ||
|
||
For example | ||
```shell | ||
terraform import netapp-ontap_quota_rules.example vol,svm,tree,test,cluster4 | ||
``` | ||
|
||
!> 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. | ||
|
||
### Terraform Import Block | ||
This requires Terraform 1.5 or higher, and will auto create the configuration for you | ||
|
||
First create the block | ||
```terraform | ||
import { | ||
to = netapp-ontap_quota_rules.lun_import | ||
id = "vol,svm,tree,test,cluster4" | ||
} | ||
``` | ||
Next run, this will auto create the configuration for you | ||
```shell | ||
terraform plan -generate-config-out=generated.tf | ||
``` | ||
This will generate a file called generated.tf, which will contain the configuration for the imported resource | ||
```terraform | ||
# __generated__ by Terraform | ||
# Please review these resources and move them into your main configuration files. | ||
# __generated__ by Terraform from "vol,svm,tree,test,cluster4" | ||
resource "netapp-ontap_quota_rules" "storage_quota_rules" { | ||
cx_profile_name = "cluster4" | ||
files = { | ||
hard_limit = 100 | ||
soft_limit = 80 | ||
} | ||
group = null | ||
id = "abcd" | ||
qtree = { | ||
name = "testacc" | ||
} | ||
svm = { | ||
name = "carchi-test" | ||
} | ||
type = "tree" | ||
users = null | ||
volume = { | ||
name = "lunTest" | ||
} | ||
} | ||
``` |
1 change: 1 addition & 0 deletions
1
examples/resources/netapp-ontap_storage_quota_rules/provider.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../provider/provider.tf |
21 changes: 21 additions & 0 deletions
21
examples/resources/netapp-ontap_storage_quota_rules/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
resource "netapp-ontap_quota_rules" "storage_quota_rules" { | ||
# required to know which system to interface with | ||
cx_profile_name = "cluster2" | ||
volume = { | ||
name = "lunTest" | ||
} | ||
svm = { | ||
name = "carchi-test" | ||
} | ||
type = "tree" | ||
qtree = { | ||
name = "" | ||
} | ||
users = [{ | ||
name = "" | ||
}] | ||
files = { | ||
hard_limit = 100 | ||
soft_limit = 80 | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
examples/resources/netapp-ontap_storage_quota_rules/terraform.tfvars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../provider/terraform.tfvars |
1 change: 1 addition & 0 deletions
1
examples/resources/netapp-ontap_storage_quota_rules/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../provider/variables.tf |
Oops, something went wrong.