Skip to content

Commit

Permalink
Merge pull request #167 from NetApp/9-new-resource-protocols_san_igroups
Browse files Browse the repository at this point in the history
new resource protocols_san_igroup
  • Loading branch information
carchi8py authored Apr 15, 2024
2 parents 0e5cf5c + 36e9229 commit d2fabba
Show file tree
Hide file tree
Showing 20 changed files with 875 additions and 169 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/acc_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.19.3'
go-version: '1.21'

- name: Build
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/blackduck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.19.3'
go-version: '1.21'
- uses: actions/checkout@v3

- name: Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.19.3'
go-version: '1.21'

- name: Build
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.19.3'
go-version: '1.21'

- name: Build
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.19.3'
go-version: '1.21'

- name: Build
run: |
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ FEATURES:
* **New Resource:** `netapp-ontap_protocols_san_lun-maps_resource` ([#13](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/13))
* **New Resource:** `netapp-ontap_name_services_ldap_resource` ([#25](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/25))
* **New Resource:** `netapp-ontap_protocols_cifs_service_resource` ([#23](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/23))
* **New Resource:** `netapp-ontap_protocols_san_igroup_resource` ([#9](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/9))

ENHANCEMENTS:
* **netapp-ontap_protocols_nfs_export_policy_resource**: Add support for import ([#34](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/34))
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The ONTAP Provider allows Terraform to Manage NetApp ONTAP resources.
## Requirements

* [Terraform](https://www.terraform.io/downloads.html) 1.4+
* [Go](https://golang.org/doc/install) 1.19+ (to build the provider plugin)
* [Go](https://golang.org/doc/install) 1.21+ (to build the provider plugin)

## Building The Provider

Expand Down
139 changes: 139 additions & 0 deletions docs/resources/protocols_san_igroup_resource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "netapp-ontap_protocols_san_igroup_resource Resource - terraform-provider-netapp-ontap"
subcategory: "NAS"
description: |-
ProtocolsSanIgroup resource
---

# netapp-ontap_protocols_san_igroup_resource (Resource)

Create/Modify/Delete a protocols_san_igroup resource

### Related ONTAP commands
* lun igroup create
* lun igroup modify
* lun igroup delete

## Supported Platforms
* On-perm ONTAP system 9.6 or higher
* Amazon FSx for NetApp ONTAP

## Example Usage
```
# Create a protocols_san_igroup
resource "netapp-ontap_protocols_san_igroup_resource" "protocols_san_igroups" {
# required to know which system to interface with
cx_profile_name = "cluster2"
name = "test1"
svm = {
name = "test"
}
os_type = "linux"
comment = "test"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `cx_profile_name` (String) Connection profile name
- `name` (String) Existing SVM in which to create the initiator group.
- `os_type` (String) Operating system of the initiator group's initiators.
- `svm` (Attributes) SVM details for ProtocolsSanLunMaps (see [below for nested schema](#nestedatt--svm))

### Optional

- `comment` (String) Comment
- `igroups` (Attributes Set) List of initiator groups (see [below for nested schema](#nestedatt--igroups))
- `initiators` (Attributes Set) List of initiators (see [below for nested schema](#nestedatt--initiators))
- `portset` (Attributes) Required ONTAP 9.9 or greater. The portset to which the initiator group is bound. Binding the initiator group to a portset restricts the initiators of the group to accessing mapped LUNs only through network interfaces in the portset. (see [below for nested schema](#nestedatt--portset))
- `protocol` (String) If not specified, the default protocol is mixed.

### Read-Only

- `id` (String) Igroup UUID

<a id="nestedatt--svm"></a>
### Nested Schema for `svm`

Required:

- `name` (String) name of the SVM


<a id="nestedatt--igroups"></a>
### Nested Schema for `igroups`

Required:

- `name` (String) Initiator group name


<a id="nestedatt--initiators"></a>
### Nested Schema for `initiators`

Required:

- `name` (String) Initiator name


<a id="nestedatt--portset"></a>
### Nested Schema for `portset`

Required:

- `name` (String) Portset name

## Import
This resource supports import, which allows you to import existing protocols_san_igroup into the state of this resource.
Import require a unique ID composed of the protocols_san_igroup name, svm_name and connection profile, separated by a comma.

id = `name`, `svm.name`, `cx_profile_name`

### Terraform Import

For example
```shell
terraform import netapp-ontap_protocols_san_igroup_resource.example name,svm_name,cluster5
```
!> 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.

### Terrafomr 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_protocols_san_igroup_resource.protocols_san_igroup_import
id = "name,svm_name,cluster5"
}
```
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 "name,svm_name,cluster5"
resource "netapp-ontap_protocols_san_igroup_resource" "protocols_san_igroup_import" {
cx_profile_name = "cluster4"
id = "abcd"
igroups = null
initiators = null
svm = {
name = "test"
}
name = "test"
os_type = "windows"
portset = {
name = "test"
}
protocol = "mixed"
}
```

2 changes: 1 addition & 1 deletion docs/resources/protocols_san_lun-maps_resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Required:
This resource supports import, which allows you to import existing protocols_san_lun-maps into the state of this resource.
Import require a unique ID composed of the protocols_san_lun-maps svm_name, igroup_name, lun_name and connection profile, separated by a comma.

id = `destination_path`,`cx_profile_name`
id = `svm.name`, `igroup.name`, `lun.name`, `cx_profile_name`

### Terraform Import

Expand Down
10 changes: 10 additions & 0 deletions examples/resources/netapp-ontap_protocols_san_igroup/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resource "netapp-ontap_protocols_san_igroup_resource" "protocols_san_igroups" {
# required to know which system to interface with
cx_profile_name = "cluster2"
name = "test1"
svm = {
name = "carchi-test"
}
os_type = "linux"
comment = "test"
}
58 changes: 30 additions & 28 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,49 +1,48 @@
module github.com/netapp/terraform-provider-netapp-ontap

go 1.19
go 1.21

require (
github.com/hashicorp/terraform-plugin-docs v0.13.0
github.com/hashicorp/terraform-plugin-framework v1.3.3
github.com/hashicorp/terraform-plugin-go v0.18.0
github.com/hashicorp/terraform-plugin-framework v1.7.0
github.com/hashicorp/terraform-plugin-go v0.22.1
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1
github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0
github.com/mitchellh/mapstructure v1.5.0
golang.org/x/exp v0.0.0-20221208152030-732eee02a75a
)

require (
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
github.com/Masterminds/semver/v3 v3.2.0 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/agext/levenshtein v1.2.2 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.4.10 // indirect
github.com/hashicorp/go-plugin v1.6.0 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hc-install v0.5.0 // indirect
github.com/hashicorp/hcl/v2 v2.16.2 // indirect
github.com/hashicorp/hc-install v0.6.3 // indirect
github.com/hashicorp/hcl/v2 v2.19.1 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-exec v0.18.1 // indirect
github.com/hashicorp/terraform-json v0.16.0 // indirect
github.com/hashicorp/terraform-exec v0.20.0 // indirect
github.com/hashicorp/terraform-json v0.21.0 // indirect
github.com/hashicorp/terraform-plugin-framework-validators v0.10.0
github.com/hashicorp/terraform-registry-address v0.2.1 // indirect
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/cli v1.1.5 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
Expand All @@ -54,22 +53,25 @@ require (
github.com/shopspring/decimal v1.3.1 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/zclconf/go-cty v1.13.1 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.15.0 // indirect
github.com/zclconf/go-cty v1.14.2 // indirect
golang.org/x/crypto v0.19.0 // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/grpc v1.56.3 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/grpc v1.62.1 // indirect
google.golang.org/protobuf v1.33.0 // indirect
)

require (
github.com/ProtonMail/go-crypto v1.1.0-alpha.0 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
)
Loading

0 comments on commit d2fabba

Please sign in to comment.