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/standalone-module/README.md
+43-42Lines changed: 43 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,23 @@
1
1
# Deploy an ONTAP FSx file-system using Terraform
2
-
This sample demonstrates how to deploy an FSx for NetApp ONTAP file system, including an SVM and a FlexVolume in that file system, using AWS Terraform provider in a standalone Terraform module.
3
-
Follow the instructions below to use this sample in your own environment.
4
-
5
2
## Table of Contents
6
3
*[Introduction](#introduction)
4
+
*[Repository Overview](#repository-overview)
5
+
*[What to expect](#what-to-expect)
7
6
*[Prerequisites](#prerequisites)
8
7
*[Usage](#usage)
9
-
*[Repository Overview](#repository-overview-1)
10
8
*[Author Information](#author-information)
11
9
*[License](#license)
12
10
13
11
## Introduction
12
+
This sample demonstrates how to deploy an FSx for NetApp ONTAP file system, including an SVM and a FlexVolume in that file system, using AWS Terraform provider in a standalone Terraform module.
13
+
Follow the instructions below to use this sample in your own environment.
14
14
### Repository Overview
15
-
This is a standalone Terraform configutation repository that contains the following files:
15
+
This is a standalone Terraform configuration repository that contains the following files:
16
16
***main.tf** - The main set of configuration for this terraform sample
17
-
18
17
***variables.tf** - Contains the variable definitions and assignments for this sample. Exported values will override any of the variables in this file.
19
-
20
18
***output.tf** - Contains output declarations of the resources created by this Terraform module. Terraform stores output values in the configuration's state file
21
19
22
20
### What to expect
23
-
24
21
Running this terraform sample will result the following:
25
22
* Create a new AWS Security Group in your VPC with the following rules:
26
23
-**Ingress** allow all ICMP traffic
@@ -33,7 +30,7 @@ Running this terraform sample will result the following:
33
30
* 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:
34
31
* 1024Gb of storage capacity
35
32
* Multi AZ deployment type
36
-
*256Mbps of throughput capacity
33
+
*128Mbps of throughput capacity
37
34
38
35
* Create a Storage Virtual Maching (SVM) in this new file-system named "_first_svm_"
39
36
* Create a new FlexVol volume in this SVM named "_vol1_" with the following configuration parameters:
@@ -43,7 +40,7 @@ Running this terraform sample will result the following:
43
40
* post-delete backup disabled
44
41
45
42
> [!NOTE]
46
-
> All of the above configuration parameters can be modified for your preference by assigning your own values in the `variables.tf` file!
43
+
> Even though this Terraform code is set up to use AWS SecretsManager to retrieve the FSxN password, it will store the password in its `state database`. Therefore, it is assumed you have properly secured that database so that unauthorized personal can't access the password.
47
44
48
45
## Prerequisites
49
46
@@ -54,8 +51,8 @@ Running this terraform sample will result the following:
@@ -73,41 +70,41 @@ Running this terraform sample will result the following:
73
70
> [!NOTE]
74
71
> In this sample, the AWS Credentials were configured through [AWS CLI](https://aws.amazon.com/cli/), which adds them to a shared configuration file (option 4 above). Therefore, this documentation only provides guidance on setting-up the AWS credentials with shared configuration file using AWS CLI.
75
72
76
-
#### Configure AWS Credentials using AWS CLI
77
-
78
-
The AWS Provider can source credentials and other settings from the shared configuration and credentials files. By default, these files are located at `$HOME/.aws/config` and `$HOME/.aws/credentials` on Linux and macOS, and `"%USERPROFILE%\.aws\credentials"` on Windows.
73
+
#### Configure AWS Credentials using AWS CLI
79
74
80
-
There are several ways to set your credentials and configuration setting using AWS CLI. We will use [`aws configure`](https://docs.aws.amazon.com/cli/latest/reference/configure/index.html) command:
75
+
The AWS Provider can source credentials and other settings from the shared configuration and credentials files. By default, these files are located at `$HOME/.aws/config` and `$HOME/.aws/credentials` on Linux and macOS, and `"%USERPROFILE%\.aws\credentials"` on Windows.
81
76
82
-
Run the following command to quickly set and view your credentails, region, and output format. The following example shows sample values:
77
+
There are several ways to set your credentials and configuration setting using AWS CLI. We will use [`aws configure`](https://docs.aws.amazon.com/cli/latest/reference/configure/index.html) command:
Default region name [None]: < YOUR-PREFERRED-REGION >
89
-
Default output format [None]: json
90
-
```
91
-
92
-
To list configuration data, use the [`aws configire list`](https://docs.aws.amazon.com/cli/latest/reference/configure/list.html) command. This command lists the profile, access key, secret key, and region configuration information used for the specified profile. For each configuration item, it shows the value, where the configuration value was retrieved, and the configuration variable name.
79
+
Run the following command to quickly set and view your credentails, region, and output format. The following example shows sample values:
Default region name [None]: < YOUR-PREFERRED-REGION >
86
+
Default output format [None]: json
87
+
```
94
88
89
+
To list configuration data, use the [`aws configire list`](https://docs.aws.amazon.com/cli/latest/reference/configure/list.html) command. This command lists the profile,
90
+
access key, secret key, and region configuration information used for the specified profile. For each configuration item, it shows the value, where the configuration
91
+
value was retrieved, and the configuration variable name.
95
92
96
93
## Usage
97
94
98
-
####1. Clone the repository
95
+
### 1. Clone the repository
99
96
In your server's terminal, navigate to the location where you wish to store this Terraform repository, and clone the repository using your preferred authentication type. In this example we are using HTTPS clone:
This directory represents a standalone Terraform module. Run the following command to initialize the module and install all dependencies:
112
109
```shell
113
110
terraform init
@@ -134,22 +131,23 @@ commands will detect it and remind you to do so if necessary.
134
131
```
135
132
You can see that Terraform recognizes the modules required by our configuration: `hashicorp/aws`.
136
133
137
-
#### 4. Update Variables
134
+
### 4. Update Variables
138
135
139
-
a. Open the **`variables.tf`** file in your preferred text editor. Update the values of the variables to match your preferences and save the file. This will ensure that the Terraform code deploys resources according to your specifications.
136
+
- Open the **`variables.tf`** file in your preferred text editor. Update the values of the variables to match your
137
+
preferences and save the file. This will ensure that the Terraform code deploys resources according to your specifications.
140
138
141
139
**Make sure to replace the values with ones that match your AWS environment and needs.**
142
140
143
-
b. modify the remaining optional variables in the **`main.tf`** file and remove commenting where needed according to the explenations in-line.
141
+
- Modify the remaining optional variables in the **`main.tf`** file and remove commenting where needed according to the explanations in-line.
144
142
145
-
#### 5. Create a Terraform plan
143
+
### 5. Create a Terraform plan
146
144
Run the following command to create an execution plan, which lets you preview the changes that Terraform plans to make to your infrastructure:
147
145
```shell
148
146
terraform plan
149
147
```
150
148
Ensure that the proposed changes match what you expected before you apply the changes!
151
149
152
-
#### 6. Apply the Terraform plan
150
+
### 6. Apply the Terraform plan
153
151
Run the following command to execute the Terrafom code and apply the changes proposed in the `plan` step:
154
152
```shell
155
153
terraform apply
@@ -164,20 +162,23 @@ terraform apply
164
162
| Name | Version |
165
163
|------|---------|
166
164
| aws | 5.25.0 |
165
+
| aws.secrets | 5.25.0 |
167
166
168
167
### Inputs
169
168
170
169
| Name | Description | Type | Default | Required |
|fsx_admin_password| The ONTAP administrative password forthe fsxadmin user that you can use to administer your file system using the ONTAP CLI and REST API |`string`|`"password"`| no |
173
-
| fsx_capacity_size_gb | The storage capacity (GiB) of the FSxN file system. Valid values between 1024 and 196608 |`number`|`1024`| no |
171
+
|aws_secretsmanager_region| The AWS region where the secret is stored. |`string`|`"us-east-2"`| no |
172
+
| fsx_capacity_size_gb | The storage capacity (GiB) of the FSxN file system. Valid values between 1024 and 196608.|`number`|`1024`| no |
174
173
| fsx_deploy_type | The filesystem deployment type. Supports MULTI_AZ_1 and SINGLE_AZ_1 |`string`|`"MULTI_AZ_1"`| no |
175
174
| fsx_name | The deployed filesystem name |`string`|`"terraform-fsxn"`| no |
176
-
| 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": "",<br>"secondarysub": ""<br>}</pre>| no |
177
-
| fsx_tput_in_MBps | The throughput capacity (in MBps) for the file system. Valid values are 128, 256, 512, 1024, 2048, and 4096. |`number`|`256`| no |
175
+
| fsx_region | The AWS region where the FSxN file system to be deployed. |`string`|`"us-west-2"`| no |
176
+
| 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 |
178
+
| 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 |
178
179
| svm_name | The name of the Storage Virtual Machine |`string`|`"first_svm"`| no |
179
180
| 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 |
180
-
| vpc_id | The ID of the VPC in which the FSxN fikesystem should be deployed |`string`|`"vpc-111111111"`| no |
181
+
| vpc_id | The ID of the VPC in which the FSxN fikesystem should be deployed |`string`|`"vpc-11111111"`| no |
181
182
182
183
### Outputs
183
184
@@ -204,4 +205,4 @@ See the License for the specific language governing permissions and limitations
0 commit comments