Skip to content

Commit cc61f10

Browse files
authored
Merge branch 'main' into add_monitoring_readme
2 parents c853c02 + 3327cfe commit cc61f10

File tree

2 files changed

+47
-92
lines changed

2 files changed

+47
-92
lines changed

Terraform/deploy-fsx-ontap/module/README.md

Lines changed: 38 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
This is a Terraform module which creates an FSx for NetApp ONTAP file system in a multi-AZ fashion, including an SVM, a Security-Group and a FlexVolume in that file system, using AWS Terraform provider.
33
This repo should be sourced as a terraform module, and does not need to be cloned locally!
44
Follow the instructions below to use this sample in your environment.
5-
> [!NOTE]
6-
> This module does not support scale-out! One ha pair per deployment.
75

86
## Table of Contents
97
* [Introduction](#introduction)
@@ -35,22 +33,24 @@ Calling this terraform module will result the following:
3533
- **Ingress** allow https port 443
3634
- **Egress** allow all traffic
3735

38-
* Two new AWS secrets. One that contains the fsxadmin password and another that contains the SVM admin password.
36+
* Create two new AWS secrets. One that contains the fsxadmin password and another that contains the SVM admin password.
3937

40-
* Create a new FSx for Netapp ONTAP file-system in your AWS account named "_terraform-fsxn_". The file-system will be created with the following configuration parameters:
38+
* Create a new FSx for Netapp ONTAP file-system. Much of the configuration has default values, but can be modified to your preference by providing your own values in the module block. The default configuration includes:
4139
* 1024Gb of storage capacity
42-
* Multi AZ deployment type
43-
* 128Mbps of throughput capacity
44-
45-
* Create a Storage Virtual Maching (SVM) in this new file-system named "_first_svm_"
46-
47-
* Create a new FlexVol volume in this SVM named "_vol1_" with the following configuration parameters:
48-
* Size of 1024Mb
49-
* Storage efficiencies mechanism enabled
50-
* Auto tiering policy with 31 cooling days
40+
* Generation 1 Multi AZ deployment type
41+
* 128Mbps of throughput capacity
42+
* 1 HA pair
43+
* 1 Storage Virtual Machine (SVM)
44+
* 1 FlexVol volume with the following configuration parameters:
45+
* Size of 2TB - Thin provisioned
46+
* Junction path of /vol1
47+
* Security style of UNIX
48+
* Storage efficiencies enabled
49+
* Auto tiering policy with 31 cooling days
50+
* post-delete backup disabled
5151

5252
> [!NOTE]
53-
> All of the above configuration parameters can be modified for your preference by assigning your own values in the module block!
53+
> All of the above configuration parameters can be modified for your preference by assigning your own values in the module block! See below for more information.
5454
5555
## Prerequisites
5656

@@ -113,7 +113,7 @@ terraform {
113113
required_providers {
114114
aws = {
115115
source = "hashicorp/aws"
116-
version = "5.25"
116+
version >= "5.25"
117117
}
118118
}
119119
}
@@ -126,78 +126,37 @@ provider "aws" {
126126
### Reference this module
127127

128128
Add the following module block to your local `main.tf` file.
129-
Make sure to replace all values within `< >` with your own variables.
129+
Of course changing the subnets, route_table_ids, and other variables to match your environment.
130+
You will find below a complete list of all the parameters that can be passed to the module block.
130131

131132
```hcl
132133
module "fsxontap" {
133-
source = "github.com/Netapp/FSx-ONTAP-samples-scripts/Terraform/deploy-fsx-ontap/module"
134+
source = "/home/ckeith/DevelopersAdocacy/FSx-ONTAP-samples-scripts/Terraform/deploy-fsx-ontap/module"
134135
135-
vpc_id = "<YOUR-VPC-ID>"
136-
fsx_subnets = {
137-
primarysub = "<YOUR-PRIMARY-SUBNET>"
138-
secondarysub = "<YOUR-SECONDAY-SUBNET>"
139-
}
140-
create_sg = true // true to create Security Group for the Fs / false otherwise
141-
cidr_for_sg = "<YOUR-CIDR-BLOCK>"
142-
fsx_secret_name = "<YOUR_SECRET>" // The name of a secret in AWS Secrets Manager that contains the FSxN admin password.
143-
tags = {
144-
Terraform = "true"
145-
Environment = "dev"
146-
}
147-
}
148-
```
136+
name = "Development"
149137
150-
> [!NOTE]
151-
> To Override default values assigned to other variables in this module, add them to this source block as well. The above source block includes the minimum requirements only.
138+
deployment_type = "MULTI_AZ_2"
139+
ha_pairs = 1
140+
throughput_in_MBps = 384
152141
153-
> [!NOTE]
154-
> The default deployment type is: MULTI_AZ_1. For SINGLE AZ deployment, set the `fsx_deploy_type` variable to SINGLE_AZ_1 in the module block.
155-
156-
Please read the vriables descriptions in `variables.tf` file for more information regarding the variables passed to the module block.
157-
158-
### Example main.tf file
159-
160-
For a quick and easy start, copy and paste the below example to your main.tf file and modify the variables with your enviroonment's values.
161-
162-
```hcl
163-
terraform {
164-
required_providers {
165-
aws = {
166-
source = "hashicorp/aws"
167-
version = "5.25"
142+
subnets = {
143+
"primarysub" = "subnet-11111111"
144+
"secondarysub" = "subnet-22222222"
168145
}
169-
}
170-
}
171-
172-
provider "aws" {
173-
region = "us-west-2"
174-
}
175-
176-
177-
module "fsxontap" {
178-
source = "github.com/Netapp/FSx-ONTAP-samples-scripts/Terraform/deploy-fsx-ontap/module"
146+
route_table_ids = ["rtb-abcd1234"]
179147
180-
name = "fsxontap"
181-
182-
vpc_id = "vpc-111111111"
183-
fsx_subnets = {
184-
"primarysub" = "subnet-11111111"
185-
"secondarysub" = "subnet-2222222"
186-
}
187148
create_sg = true
149+
security_group_name_prefix = "fsxn-sg"
150+
vpc_id = "vpc-88888888"
188151
cidr_for_sg = "10.0.0.0/8"
189-
fsx_secret_name = "fsx_secret"
190-
route_table_ids = ["rtb-111111"]
191-
tags = {
192-
Terraform = "true"
193-
Environment = "dev"
194-
}
195152
}
196153
```
197154

198155
### Install the module
199156

200-
Whenever you add a new module to a configuration, Terraform must install the module before it can be used. Both the `terraform get` and `terraform init` commands will install and update modules. The `terraform init` command will also initialize backends and install plugins.
157+
Whenever you add a new module to a configuration, Terraform must install the module before
158+
it can be used. Both the `terraform get` and `terraform init` commands will install and
159+
update modules. The `terraform init` command will also initialize backends and install plugins.
201160

202161
Command:
203162
```shell
@@ -259,31 +218,31 @@ terraform apply
259218
260219
| Name | Description | Type | Default | Required |
261220
|------|-------------|------|---------|:--------:|
221+
| subnets | A map specifying the subnets where the management and data endpoints will be deployed. There are two suppoted keys: 'primarysub' which specfies where the 'active' node's endpoint will be located. 'secondarysub' where the standby node's endpoint will be located. Both must be specified if you are deploying a MULTI_AZ file system. Only the primary subnet is used for a SINGLE_AZ file system. | `map(string)` | n/a | yes |
262222
| aws_account_id | The AWS account ID. Used to create account specific permissions on the secrets that are created. Use the default for less specific permissions. | `string` | `"*"` | no |
263223
| backup_retention_days | The number of days to retain automatic backups. Setting this to 0 disables automatic backups. You can retain automatic backups for a maximum of 90 days. | `number` | `0` | no |
264224
| capacity_size_gb | The storage capacity in GiBs of the FSxN file system. Valid values between 1024 (1 TiB) and 1048576 (1 PiB). Gen 1 deployment types are limited to 192 TiB. Gen 2 Multi AZ is limited to 512 TiB. Gen 2 Single AZ is limited to 1 PiB. | `number` | `1024` | no |
265225
| cidr_for_sg | The cidr block to be used for the created security ingress rules. Set to an empty string if you want to use the source_sg_id as the source. | `string` | `""` | no |
266226
| create_sg | Determines whether the Security Group should be created as part of this deployment or not. | `bool` | `true` | no |
267-
| daily_backup_start_time | A recurring daily time, in the format HH:MM. HH is the zero-padded hour of the day (0-23), and MM is the zero-padded minute of the hour. Requires automatic_backup_retention_days to be set. | `string` | `"00:00"` | no |
227+
| daily_backup_start_time | A recurring daily time, in the format HH:MM. HH is the zero-padded hour of the day (0-23), and MM is the zero-padded minute of the hour. Requires automatic_backup_retention_days to be set. | `string` | `null` | no |
268228
| deployment_type | The file system deployment type. Supported values are 'MULTI_AZ_1', 'SINGLE_AZ_1', 'MULTI_AZ_2', and 'SINGLE_AZ_2'. MULTI_AZ_1 and SINGLE_AZ_1 are Gen 1. MULTI_AZ_2 and SINGLE_AZ_2 are Gen 2. | `string` | `"MULTI_AZ_1"` | no |
269229
| disk_iops_configuration | The SSD IOPS configuration for the file system. Valid modes are 'AUTOMATIC' (3 iops per GB provisioned) or 'USER_PROVISIONED'. NOTE: Due to a bug in the AWS FSx Terraform provider, if you want AUTOMATIC, then leave this variable empty. If you want USER_PROVISIONED, then add a 'mode=USER_PROVISIONED' (with USER_PROVISIONED enclosed in double quotes) and 'iops=number' where number is between 1 and 160000. | `map(any)` | `{}` | no |
270230
| endpoint_ip_address_range | The IP address range that the FSxN file system will be accessible from. This is only used for Mutli AZ deployment types and must be left a null for Single AZ deployment types. | `string` | `null` | no |
271-
| ha_pairs | The number of HA pairs in the file system. Valid values are from 1 through 12. Only single AZ Gen 2 deployment type supports more than 1 HA pair. | `number` | `1` | no |
231+
| ha_pairs | The number of HA pairs in the file system. Valid values are from 1 through 12. Only the Single AZ Gen 2 deployment type supports more than 1 HA pair. | `number` | `1` | no |
272232
| kms_key_id | ARN for the KMS Key to encrypt the file system at rest. Defaults to an AWS managed KMS Key. | `string` | `null` | no |
273-
| maintenance_start_time | The preferred start time to perform weekly maintenance, in UTC time zone. The format is 'D:HH:MM' format. D is the day of the week, where 1=Monday and 7=Sunday. | `string` | `"7:00:00"` | no |
274-
| name | The name to assign to the FSxN file system. | `string` | `"fsxn"` | no |
233+
| maintenance_start_time | The preferred start time to perform weekly maintenance, in UTC time zone. The format is 'D:HH:MM' format. D is the day of the week, where 1=Monday and 7=Sunday. | `string` | `null` | no |
234+
| name | The name to assign to the FSx for ONTAP file system. | `string` | `"fsxn"` | no |
275235
| root_vol_sec_style | Specifies the root volume security style, Valid values are UNIX, NTFS, and MIXED (although MIXED is not recommended). All volumes created under this SVM will inherit the root security style unless the security style is specified on the volume. | `string` | `"UNIX"` | no |
276236
| route_table_ids | An array of routing table IDs that will be modified to allow access to the FSxN file system. This is only used for Multi AZ deployment types and must be left as null for Single AZ deployment types. | `list(string)` | `null` | no |
277237
| secret_name_prefix | The prefix to the secret name that will be created that will contain the FSxN passwords (system, and SVM). | `string` | `"fsxn-secret"` | no |
278238
| secrets_region | The AWS region where the secrets for the FSxN file system and SVM will be deployed. | `string` | `""` | no |
279239
| security_group_id | If you are not creating the security group, provide the ID of the security group to be used. | `string` | `""` | no |
280240
| security_group_name_prefix | The prefix to the security group name that will be created. | `string` | `"fsxn-sg"` | no |
281241
| source_sg_id | The ID of the security group to allow access to the FSxN file system. Set to an empty string if you want to use the cidr_for_sg as the source. | `string` | `""` | no |
282-
| subnets | The primary subnet ID, and secondary subnet ID if you are deploying in a Multi AZ environment, the file system will be accessible from. For MULTI_AZ deployment types both subnets are required. For SINGLE_AZ deployment type, only the primary subnet is used. | `map(string)` | <pre>{<br> "primarysub": "subnet-111111111",<br> "secondarysub": "subnet-222222222"<br>}</pre> | no |
283242
| svm_name | name of the Storage Virtual Machine, (a.k.a. vserver). | `string` | `"fsx"` | no |
284-
| tags | Tags to be applied to the FSxN file system. The format is '{Name1 = value, Name2 = value}'. | `map(any)` | `{}` | no |
243+
| tags | A map defining tags to be applied to the FSxN file system. The format is '{Name1 = value, Name2 = value}'. | `map(any)` | `null` | no |
285244
| throughput_in_MBps | The throughput capacity (in MBps) for the file system. Valid values are 128, 256, 512, 1024, 2048, and 4096 for Gen 1, and 384, 768, 1536, 3072 and 6144 for Gen 2. | `string` | `"128"` | no |
286-
| vol_info | Details for the volume creation | <pre>object({<br> vol_name = optional(string, "vol1")<br> junction_path = optional(string, "/vol1")<br> size_mg = optional(number, 1024)<br> efficiency = optional(bool, true)<br> tier_policy_name = optional(string, "AUTO")<br> cooling_period = optional(string, 31)<br> vol_type = optional(string, "RW")<br> copy_tags_to_backups = optional(bool, false)<br> sec_style = optional(string, "UNIX")<br> skip_final_backup = optional(bool, false)<br> snapshot_policy = optional(string, "default")<br> })</pre> | `{}` | no |
245+
| vol_info | Details for the initial volume creation. | <pre>object({<br> vol_name = optional(string, "vol1")<br> junction_path = optional(string, "/vol1")<br> size_mg = optional(number, 2048000)<br> efficiency = optional(bool, true)<br> tier_policy_name = optional(string, "AUTO")<br> cooling_period = optional(string, 31)<br> vol_type = optional(string, "RW")<br> copy_tags_to_backups = optional(bool, false)<br> sec_style = optional(string, "UNIX")<br> skip_final_backup = optional(bool, false)<br> snapshot_policy = optional(string, "default")<br> })</pre> | `{}` | no |
287246
| vpc_id | The VPC ID where the security group will be created. | `string` | `""` | no |
288247
289248
### Outputs

Terraform/deploy-fsx-ontap/module/variables.tf

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
variable "name" {
2-
description = "The name to assign to the FSxN file system."
2+
description = "The name to assign to the FSx for ONTAP file system."
33
type = string
44
default = "fsxn"
55
}
@@ -41,7 +41,7 @@ variable "disk_iops_configuration" {
4141
}
4242

4343
variable "ha_pairs" {
44-
description = "The number of HA pairs in the file system. Valid values are from 1 through 12. Only single AZ Gen 2 deployment type supports more than 1 HA pair."
44+
description = "The number of HA pairs in the file system. Valid values are from 1 through 12. Only the Single AZ Gen 2 deployment type supports more than 1 HA pair."
4545
type = number
4646
default = 1
4747
validation {
@@ -51,12 +51,8 @@ variable "ha_pairs" {
5151
}
5252

5353
variable "subnets" {
54-
description = "The primary subnet ID, and secondary subnet ID if you are deploying in a Multi AZ environment, the file system will be accessible from. For MULTI_AZ deployment types both subnets are required. For SINGLE_AZ deployment type, only the primary subnet is used."
54+
description = "A map specifying the subnets where the management and data endpoints will be deployed. There are two suppoted keys: 'primarysub' which specfies where the 'active' node's endpoint will be located. 'secondarysub' where the standby node's endpoint will be located. Both must be specified if you are deploying a MULTI_AZ file system. Only the primary subnet is used for a SINGLE_AZ file system."
5555
type = map(string)
56-
default = {
57-
"primarysub" = "subnet-111111111"
58-
"secondarysub" = "subnet-222222222"
59-
}
6056
}
6157

6258
variable "endpoint_ip_address_range" {
@@ -74,7 +70,7 @@ variable "route_table_ids" {
7470
variable "maintenance_start_time" {
7571
description = "The preferred start time to perform weekly maintenance, in UTC time zone. The format is 'D:HH:MM' format. D is the day of the week, where 1=Monday and 7=Sunday."
7672
type = string
77-
default = "7:00:00"
73+
default = null
7874
}
7975

8076
variable "kms_key_id" {
@@ -96,13 +92,13 @@ variable "backup_retention_days" {
9692
variable "daily_backup_start_time" {
9793
description = "A recurring daily time, in the format HH:MM. HH is the zero-padded hour of the day (0-23), and MM is the zero-padded minute of the hour. Requires automatic_backup_retention_days to be set."
9894
type = string
99-
default = "00:00"
95+
default = null
10096
}
10197

10298
variable "tags" {
103-
description = "Tags to be applied to the FSxN file system. The format is '{Name1 = value, Name2 = value}'."
99+
description = "A map defining tags to be applied to the FSxN file system. The format is '{Name1 = value, Name2 = value}'."
104100
type = map(any)
105-
default = {}
101+
default = null
106102
}
107103

108104
/*
@@ -142,11 +138,11 @@ variable "root_vol_sec_style" {
142138
}
143139

144140
variable "vol_info" {
145-
description = "Details for the volume creation"
141+
description = "Details for the initial volume creation."
146142
type = object({
147143
vol_name = optional(string, "vol1")
148144
junction_path = optional(string, "/vol1")
149-
size_mg = optional(number, 1024)
145+
size_mg = optional(number, 2048000)
150146
efficiency = optional(bool, true)
151147
tier_policy_name = optional(string, "AUTO")
152148
cooling_period = optional(string, 31)

0 commit comments

Comments
 (0)