Skip to content

Commit 7cdbcb7

Browse files
authored
Merge pull request #136 from NetApp/update_terraform_fsxn
Split out the definition of the security group to a separate file.
2 parents f003017 + db6ff98 commit 7cdbcb7

File tree

4 files changed

+254
-120
lines changed

4 files changed

+254
-120
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,13 @@ terraform apply
168168
169169
| Name | Description | Type | Default | Required |
170170
|------|-------------|------|---------|:--------:|
171-
| aws_secretsmanager_region | The AWS region where the secret is stored. | `string` | `"us-east-2"` | no |
171+
| aws_secretsmanager_region | The AWS region where the secret is stored. Can be different from the region where the FSxN file system is deployed. | `string` | `"us-east-2"` | no |
172172
| fsx_capacity_size_gb | The storage capacity (GiB) of the FSxN file system. Valid values between 1024 and 196608. | `number` | `1024` | no |
173173
| fsx_deploy_type | The filesystem deployment type. Supports MULTI_AZ_1 and SINGLE_AZ_1 | `string` | `"MULTI_AZ_1"` | no |
174174
| fsx_name | The deployed filesystem name | `string` | `"terraform-fsxn"` | no |
175175
| fsx_region | The AWS region where the FSxN file system to be deployed. | `string` | `"us-west-2"` | no |
176176
| fsx_secret_name | The name of the AWS SecretManager secret that holds the ONTAP administrative password for the fsxadmin user that you can use to administer your file system using the ONTAP CLI and REST API. | `string` | `"fsx_secret"` | no |
177-
| fsx_subnets | A list of IDs for the subnets that the file system will be accessible from. Up to 2 subnets can be provided. | `map(any)` | <pre>{<br> "primarysub": "subnet-22222222",<br> "secondarysub": "subnet-22222222"<br>}</pre> | no |
177+
| fsx_subnets | A list of subnets IDs that the file system will be accessible from. For MULTI_AZ_1 deployment type, provide both subnets. For SINGLE_AZ_1 deployment type, only the primary subnet is used. | `map(any)` | <pre>{<br> "primarysub": "subnet-22222222",<br> "secondarysub": "subnet-33333333"<br>}</pre> | no |
178178
| fsx_tput_in_MBps | The throughput capacity (in MBps) for the file system. Valid values are 128, 256, 512, 1024, 2048, and 4096. | `number` | `128` | no |
179179
| svm_name | The name of the Storage Virtual Machine | `string` | `"first_svm"` | no |
180180
| vol_info | Details for the volume creation | `map(any)` | <pre>{<br> "cooling_period": 31,<br> "efficiency": true,<br> "junction_path": "/vol1",<br> "size_mg": 1024,<br> "tier_policy_name": "AUTO",<br> "vol_name": "vol1"<br>}</pre> | no |

Terraform/deploy-fsx-ontap/standalone-module/main.tf

Lines changed: 1 addition & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -18,120 +18,6 @@ provider "aws" {
1818
region = var.aws_secretsmanager_region
1919
}
2020

21-
/*
22-
* The following resources are a Security Group followed by ingress and egress rules for FSx ONTAP.
23-
* The Security Group is not required for deploying FSx ONTAP, but is included here for completeness.
24-
*
25-
* - If you wish to skip this resource, comment out the resource blocks of the Security Group and the rules.
26-
*
27-
* - If you wish to use the Security Group, choose the relevant source for the ingress rules (can be either cidr block or security group id)
28-
* and modify/uncomment the relevant line in the resource block. Make sure you add your specific value as well.
29-
* Note that currently all rules are configured for source cidr: 10.0.0.0/8
30-
*
31-
* Note that a source reference for a Security Group is optional, but is considered to be a best practice.
32-
* Feel free to add, remove, or change the rules as needed. The rules below are just a suggestion for basic functionality.
33-
*/
34-
resource "aws_security_group" "fsx_sg" {
35-
name = "fsx_sg"
36-
description = "Allow FSx ONTAP required ports"
37-
vpc_id = var.vpc_id
38-
}
39-
40-
resource "aws_vpc_security_group_ingress_rule" "all_icmp" {
41-
security_group_id = aws_security_group.fsx_sg.id
42-
description = "Allow all ICMP traffic"
43-
cidr_ipv4 = "0.0.0.0/0"
44-
from_port = -1
45-
to_port = -1
46-
ip_protocol = "icmp"
47-
}
48-
49-
resource "aws_vpc_security_group_ingress_rule" "nfs_tcp" {
50-
security_group_id = aws_security_group.fsx_sg.id
51-
description = "Remote procedure call for NFS"
52-
cidr_ipv4 = "10.0.0.0/8"
53-
// referenced_security_group_id = "sg-11111111111111111"
54-
from_port = 111
55-
to_port = 111
56-
ip_protocol = "tcp"
57-
}
58-
59-
resource "aws_vpc_security_group_ingress_rule" "nfs_udp" {
60-
security_group_id = aws_security_group.fsx_sg.id
61-
description = "Remote procedure call for NFS"
62-
cidr_ipv4 = "10.0.0.0/8"
63-
// referenced_security_group_id = "sg-11111111111111111"
64-
from_port = 111
65-
to_port = 111
66-
ip_protocol = "udp"
67-
}
68-
69-
resource "aws_vpc_security_group_ingress_rule" "cifs" {
70-
security_group_id = aws_security_group.fsx_sg.id
71-
description = "NetBIOS service session for CIFS"
72-
cidr_ipv4 = "10.0.0.0/8"
73-
// referenced_security_group_id = "sg-11111111111111111"
74-
from_port = 139
75-
to_port = 139
76-
ip_protocol = "tcp"
77-
}
78-
79-
resource "aws_vpc_security_group_ingress_rule" "snmp_tcp" {
80-
security_group_id = aws_security_group.fsx_sg.id
81-
description = "Simple network management protocol for log collection"
82-
cidr_ipv4 = "10.0.0.0/8"
83-
// referenced_security_group_id = "sg-11111111111111111"
84-
from_port = 161
85-
to_port = 162
86-
ip_protocol = "tcp"
87-
}
88-
89-
resource "aws_vpc_security_group_ingress_rule" "snmp_udp" {
90-
security_group_id = aws_security_group.fsx_sg.id
91-
description = "Simple network management protocol for log collection"
92-
cidr_ipv4 = "10.0.0.0/8"
93-
// referenced_security_group_id = "sg-11111111111111111"
94-
from_port = 161
95-
to_port = 162
96-
ip_protocol = "udp"
97-
}
98-
99-
resource "aws_vpc_security_group_ingress_rule" "smb_cifs" {
100-
security_group_id = aws_security_group.fsx_sg.id
101-
description = "Microsoft SMB/CIFS over TCP with NetBIOS framing"
102-
cidr_ipv4 = "10.0.0.0/8"
103-
// referenced_security_group_id = "sg-11111111111111111"
104-
from_port = 445
105-
to_port = 445
106-
ip_protocol = "tcp"
107-
}
108-
109-
resource "aws_vpc_security_group_ingress_rule" "nfs_mount_tcp" {
110-
security_group_id = aws_security_group.fsx_sg.id
111-
description = "NFS mount"
112-
cidr_ipv4 = "10.0.0.0/8"
113-
// referenced_security_group_id = "sg-11111111111111111"
114-
from_port = 635
115-
to_port = 635
116-
ip_protocol = "tcp"
117-
}
118-
119-
resource "aws_vpc_security_group_ingress_rule" "nfs_mount_udp" {
120-
security_group_id = aws_security_group.fsx_sg.id
121-
description = "NFS mount"
122-
cidr_ipv4 = "10.0.0.0/8"
123-
// referenced_security_group_id = "sg-11111111111111111"
124-
from_port = 635
125-
to_port = 635
126-
ip_protocol = "udp"
127-
}
128-
129-
resource "aws_vpc_security_group_egress_rule" "allow_all_traffic" {
130-
security_group_id = aws_security_group.fsx_sg.id
131-
cidr_ipv4 = "0.0.0.0/0"
132-
ip_protocol = "-1"
133-
}
134-
13521
/*
13622
* The following resources are for deploying a complete FSx ONTAP file system.
13723
* The code below deploys the following resources in this order:
@@ -158,6 +44,7 @@ resource "aws_fsx_ontap_file_system" "terraform-fsxn" {
15844
tags = {
15945
Name = var.fsx_name
16046
}
47+
16148
// Additional optional parameters that you may want to specify:
16249
# weekly_maintenance_start_time = "00:00:00"
16350
# kms_key_id = ""
@@ -166,7 +53,6 @@ resource "aws_fsx_ontap_file_system" "terraform-fsxn" {
16653
# disk_iops_configuration = ""
16754
# endpoint_ip_address_range = ""
16855
# ha_pairs = 1
169-
# Storage_type = "SSD"
17056
# route_table_ids = []
17157
# throughput_capacity_per_ha_pair = 0
17258
}

0 commit comments

Comments
 (0)