-
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 #275 from NetApp/140-new-resource-securityroles-1
140 new resource securityroles 1
- Loading branch information
Showing
13 changed files
with
978 additions
and
22 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
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,104 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "netapp-ontap_security_roles Resource - terraform-provider-netapp-ontap" | ||
subcategory: "Security" | ||
description: |- | ||
SecurityRoles resource | ||
--- | ||
|
||
# netapp-ontap_security_roles (Resource) | ||
|
||
Create/Modify/Delete a Security role | ||
|
||
## Supported Platforms | ||
* On-perm ONTAP system 9.6 or higher | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "netapp-ontap_security_roles" "security_role" { | ||
# required to know which system to interface with | ||
cx_profile_name = "cluster3" | ||
name = "testme" | ||
svm_name = "temp" | ||
privileges = [ | ||
{ | ||
access = "all" | ||
path = "lun" | ||
}, | ||
{ | ||
access = "all" | ||
path = "vserver" | ||
query = "-vserver acc_test" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `cx_profile_name` (String) Connection profile name | ||
- `name` (String) SecurityRole name | ||
|
||
### Optional | ||
|
||
- `privileges` (Attributes Set) The list of privileges that this role has been granted. (see [below for nested schema](#nestedatt--privileges)) | ||
- `svm_name` (String) SecurityRole svm name | ||
|
||
### Read-Only | ||
|
||
- `builtin` (Boolean) Indicates if this is a built-in (pre-defined) role which cannot be modified or deleted. | ||
- `id` (String) The unique identifier of the security role. | ||
- `scope` (String) Scope of the entity. Set to 'cluster' for cluster owned objects and to 'svm' for SVM owned objects. | ||
|
||
<a id="nestedatt--privileges"></a> | ||
### Nested Schema for `privileges` | ||
|
||
Optional: | ||
|
||
- `access` (String) Access level for the REST endpoint or command/command directory path. If it denotes the access level for a command/command directory path, the only supported enum values are 'none','readonly' and 'all'. | ||
- `path` (String) Either of REST URI/endpoint OR command/command directory path. | ||
- `query` (String) Requires 9.11 system or above. Optional attribute that can be specified only if the 'path' attribute refers to a command/command directory path. The privilege tuple implicitly defines a set of objects the role can or cannot access at the specified access level. The query further reduces this set of objects to a subset of objects that the role is allowed to access. The query attribute must be applicable to the command/command directory specified by the 'path' attribute. It is defined using one or more parameters of the command/command directory path specified by the 'path' attribute. | ||
|
||
## Import | ||
This Resource supports import, which allows you to import existing security role into the state of this resoruce. | ||
Import require a unique ID composed of the role name, svm_name and cx_profile_name, separated by a comma. | ||
id = `name`,`svm_name`,`cx_profile_name` | ||
|
||
### Terraform Import | ||
For example | ||
```shell | ||
terraform import netapp-ontap_security_roles.example role1,svm1,cluster1 | ||
``` | ||
|
||
!> 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_security_roles.role_import | ||
id = "role1,svm1,cluster1" | ||
} | ||
``` | ||
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 "role1,svm1,cluster1" | ||
resource "netapp-ontap_security_roles" "role1_import" { | ||
cx_profile_name = "cluster1" | ||
name = "role1" | ||
svm_name = "svm1" | ||
... | ||
} | ||
``` |
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 |
17 changes: 17 additions & 0 deletions
17
examples/resources/netapp-ontap_security_roles/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,17 @@ | ||
resource "netapp-ontap_security_roles" "security_role" { | ||
# required to know which system to interface with | ||
cx_profile_name = "cluster3" | ||
name = "testme" | ||
svm_name = "temp" | ||
privileges = [ | ||
{ | ||
access = "all" | ||
path = "lun" | ||
}, | ||
{ | ||
access = "all" | ||
path = "vserver" | ||
query = "-vserver acc_test" | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
examples/resources/netapp-ontap_security_roles/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 |
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 |
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
Oops, something went wrong.