Skip to content

Commit 0eae33c

Browse files
authored
Merge pull request #139 from NetApp/update_terraform_fsxn
Updated the README file to match recent change.
2 parents ac917e1 + aa50194 commit 0eae33c

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* [What to expect](#what-to-expect)
66
* [Prerequisites](#prerequisites)
77
* [Usage](#usage)
8+
* [Terraform Overview](#terraform-overview)
89
* [Author Information](#author-information)
910
* [License](#license)
1011

@@ -101,7 +102,7 @@ git clone https://github.com/NetApp/FSx-ONTAP-samples-scripts.git
101102

102103
### 2. Navigate to the directory
103104
```shell
104-
cd Terraform/fsx-ontap-filesystem/standalone-module
105+
cd FSx-ONTAP-samples-scripts/Terraform/deploy-fsx-ontap/standalone-module
105106
```
106107

107108
### 3. Initialize Terraform
@@ -137,17 +138,28 @@ You can see that Terraform recognizes the modules required by our configuration:
137138
preferences and save the file. This will ensure that the Terraform code deploys resources according to your specifications.
138139
139140
**Make sure to replace the values with ones that match your AWS environment and needs.**
141+
Modify the remaining optional variables (e.g. defining AD) in the **`main.tf`** file and remove commenting
142+
where needed according to the explanations in-line.
140143
141-
- Modify the remaining optional variables in the **`main.tf`** file and remove commenting where needed according to the explanations in-line.
144+
### 5. Update Security Group
145+
A default security group is defined in the "security_groups.tf" file. At the top of
146+
that file you can see where you can specify either a CIDR block or a security group ID
147+
to allow access to the FSxN file system. Do not specify both, as it will cause
148+
the terraform deployment to fail.
142149
143-
### 5. Create a Terraform plan
150+
If you decide you don't want to use the security group, you can either delete the security_groups.tf file,
151+
or just rename it such that it doesn't end with ".tf" (e.g. security_groups.tf.kep). You will also need
152+
to update the `security_group_ids = [aws_security_group.fsx_sg.id]` line in the main.tf file
153+
to reference the security group(s) you want to use.
154+
155+
### 6. Create a Terraform plan
144156
Run the following command to create an execution plan, which lets you preview the changes that Terraform plans to make to your infrastructure:
145157
```shell
146158
terraform plan
147159
```
148160
Ensure that the proposed changes match what you expected before you apply the changes!
149161
150-
### 6. Apply the Terraform plan
162+
### 7. Apply the Terraform plan
151163
Run the following command to execute the Terrafom code and apply the changes proposed in the `plan` step:
152164
```shell
153165
terraform apply

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,16 @@ resource "aws_vpc_security_group_ingress_rule" "ssh" {
241241
ip_protocol = "tcp"
242242
}
243243

244+
resource "aws_vpc_security_group_ingress_rule" "s3_and_api" {
245+
security_group_id = aws_security_group.fsx_sg.id
246+
description = "Provice acccess to S3 and the ONTAP REST API"
247+
cidr_ipv4 = (local.ciddr_block != "" ? local.ciddr_block : null)
248+
referenced_security_group_id = (local.security_group_id != "" ? local.security_group_id : null)
249+
from_port = 443
250+
to_port = 443
251+
ip_protocol = "tcp"
252+
}
253+
244254
resource "aws_vpc_security_group_egress_rule" "allow_all_traffic" {
245255
security_group_id = aws_security_group.fsx_sg.id
246256
cidr_ipv4 = "0.0.0.0/0" // Allow all output traffic.

0 commit comments

Comments
 (0)