You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Terraform/deploy-fsx-ontap/module/README.md
+38-79Lines changed: 38 additions & 79 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,6 @@
2
2
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.
3
3
This repo should be sourced as a terraform module, and does not need to be cloned locally!
4
4
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.
7
5
8
6
## Table of Contents
9
7
*[Introduction](#introduction)
@@ -35,22 +33,24 @@ Calling this terraform module will result the following:
35
33
-**Ingress** allow https port 443
36
34
-**Egress** allow all traffic
37
35
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.
39
37
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:
41
39
* 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
51
51
52
52
> [!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.
54
54
55
55
## Prerequisites
56
56
@@ -113,7 +113,7 @@ terraform {
113
113
required_providers {
114
114
aws = {
115
115
source = "hashicorp/aws"
116
-
version = "5.25"
116
+
version >= "5.25"
117
117
}
118
118
}
119
119
}
@@ -126,78 +126,37 @@ provider "aws" {
126
126
### Reference this module
127
127
128
128
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.
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"
149
137
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
152
141
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.
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.
201
160
202
161
Command:
203
162
```shell
@@ -259,31 +218,31 @@ terraform apply
259
218
260
219
| Name | Description | Type | Default | Required |
| 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 |
262
222
| 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 |
263
223
| 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 |
264
224
| 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 |
265
225
| 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 |
266
226
| 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 |
268
228
| 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 |
269
229
| disk_iops_configuration | The SSD IOPS configuration forthe file system. Valid modes are 'AUTOMATIC' (3 iops per GB provisioned) or 'USER_PROVISIONED'. NOTE: Due to a bugin 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 |
270
230
| 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 |
272
232
| 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 |
275
235
| 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 |
276
236
| 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 |
277
237
| 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 |
278
238
| secrets_region | The AWS region where the secrets for the FSxN file system and SVM will be deployed. |`string`|`""`| no |
279
239
| security_group_id | If you are not creating the security group, provide the ID of the security group to be used. |`string`|`""`| no |
280
240
| security_group_name_prefix | The prefix to the security group name that will be created. |`string`|`"fsxn-sg"`| no |
281
241
| 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 |
283
242
| 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 |
285
244
| 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 |
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."
45
45
type=number
46
46
default=1
47
47
validation {
@@ -51,12 +51,8 @@ variable "ha_pairs" {
51
51
}
52
52
53
53
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."
55
55
type=map(string)
56
-
default={
57
-
"primarysub"="subnet-111111111"
58
-
"secondarysub"="subnet-222222222"
59
-
}
60
56
}
61
57
62
58
variable"endpoint_ip_address_range" {
@@ -74,7 +70,7 @@ variable "route_table_ids" {
74
70
variable"maintenance_start_time" {
75
71
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."
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."
98
94
type=string
99
-
default="00:00"
95
+
default=null
100
96
}
101
97
102
98
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}'."
0 commit comments