diff --git a/.github/workflows/terraform-docs.yml b/.github/workflows/terraform-docs.yml index cd6d07bb..8a1c7d9a 100644 --- a/.github/workflows/terraform-docs.yml +++ b/.github/workflows/terraform-docs.yml @@ -7,10 +7,10 @@ name: "Documentation: terraform-docs" on: pull_request: paths: - - 'Terraform/**' + - 'Infrastructure_as_Code/Terraform/**' push: paths: - - 'Terraform/**' + - 'Infrastructure_as_Code/Terraform/**' branches: - main @@ -20,8 +20,8 @@ jobs: strategy: matrix: directory: - - 'Terraform/deploy-fsx-ontap/module' - - 'Terraform/deploy-fsx-ontap/standalone-module' + - 'Infrastructure_as_Code/Terraform/deploy-fsx-ontap/module' + - 'Infrastructure_as_Code/Terraform/deploy-fsx-ontap/standalone-module' steps: - name: Checkout pull request uses: actions/checkout@v3.5.0 diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 8b9ed55b..6e74c3ba 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -7,10 +7,10 @@ name: "Code Quality: Terraform" on: pull_request: paths: - - 'Terraform/**' + - 'Infrastructure_as_Code/Terraform/**' push: paths: - - 'Terraform/**' + - 'Infrastructure_as_Code/Terraform/**' branches: - main @@ -21,8 +21,8 @@ jobs: strategy: matrix: directory: - - 'Terraform/deploy-fsx-ontap/module' - - 'Terraform/deploy-fsx-ontap/standalone-module' + - 'Infrastructure_as_Code/Terraform/deploy-fsx-ontap/module' + - 'Infrastructure_as_Code/Terraform/deploy-fsx-ontap/standalone-module' defaults: run: working-directory: ${{ matrix.directory }} @@ -47,4 +47,4 @@ jobs: # run: terraform fmt -diff -check -no-color -recursive - name: Validate Terraform configuration - run: terraform validate \ No newline at end of file + run: terraform validate diff --git a/Ansible/snapmirror_report/generate_report.yaml b/Ansible/snapmirror_report/generate_report.yaml deleted file mode 100644 index 306ceab2..00000000 --- a/Ansible/snapmirror_report/generate_report.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# -# This Ansible playbook generates a SnapMirrorreport for all the -# SnapMirror relationships, in all the FSxNs, in all regions, -################################################################################# ---- -- vars: - report_name: output.csv - secrets_list_file: secrets_list.csv - secrets_region: us-west-2 -################################################################################# -# -# Don't change anything below this line. -# -################################################################################# - fsxn_regions: [] - opted_in_regions: [] - - name: Playbook to generate a SnapMirror report on all the FSxNs. - hosts: localhost - collections: - - amazon.aws - gather_facts: false - - tasks: - - name: Delete previous report while adding the header line. - ansible.builtin.shell: - cmd: echo fs,source,destination,state,healthy,lag_time > {{ report_name }} - - - name: Get all the regions that support FSxN that I am opted into. - include_tasks: get_fsxn_regions.yaml - - - name: Generate the report for all the FSxNs. - include_tasks: process_region.yaml - loop: "{{ fsxn_regions }}" - loop_control: - loop_var: region diff --git a/Ansible/snapmirror_report/process_region.yaml b/Ansible/snapmirror_report/process_region.yaml deleted file mode 100644 index aecce2c7..00000000 --- a/Ansible/snapmirror_report/process_region.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# -# Since Ansible can't handle nested loops, this is a block of tasked that is -# run for each region. It assume that the calling playbook used 'region' as its loop variable. -################################################################################# ---- -- name: Get all the FSxNs for the specified region. - ansible.builtin.shell: - cmd: aws fsx describe-file-systems --region {{ region }} --query 'FileSystems[*].{FileSystemId:FileSystemId}' --output text | sed -e '/^$/d' - register: fsxn_ids_per_region - -- name: Get the SnapMirror relationships for each FSxN. - when: secret != 'n/a' - ansible.builtin.shell: - cmd: | - fs={{ item }}; - username="{{ lookup('amazon.aws.aws_secret', '{{ secret }}.username', region=secrets_region, nested=true, on_missing='skip') }}"; - password="{{ lookup('amazon.aws.aws_secret', '{{ secret }}.password', region=secrets_region, nested=true, on_missing='skip') }}"; - if [ "$username" = '[]' -o "$password" = '[]' ]; then - echo "Missing secret for file system $fs" 1>&2; - exit 0; - fi; - ip=$(aws fsx describe-file-systems --region {{ region }} --file-system-ids $fs --query 'FileSystems[0].OntapConfiguration.Endpoints.Management.IpAddresses[0]' --output=text); - curl -s -u "${username}:${password}" -k https://$ip/api/snapmirror/relationships?fields=source,destination,lag_time,state,healthy | jq -r '.records[] | "'${fs}',\(.source.path),\(.destination.path),\(.state),\(.healthy),\(.lag_time)"' - loop: "{{ fsxn_ids_per_region.stdout_lines }}" - register: snapmirror_relationships - vars: - secret: "{{ lookup('ansible.builtin.csvfile', item, file=secrets_list_file, delimiter=',', default='n/a') }}" - -- name: Write the SnapMirror relationships to a file. - when: item.stdout is defined - ansible.builtin.shell: - cmd: | - if [ "{{ item.stdout }}" != "" ]; then - echo "{{ item.stdout }}" >> {{ report_name }}; - fi - loop: "{{ snapmirror_relationships.results }}" diff --git a/Ansible/README.md b/Infrastructure_as_Code/Ansible/README.md similarity index 75% rename from Ansible/README.md rename to Infrastructure_as_Code/Ansible/README.md index aedd3e47..5b135471 100644 --- a/Ansible/README.md +++ b/Infrastructure_as_Code/Ansible/README.md @@ -6,8 +6,9 @@ Click here for more information on [Ansible](https://www.ansible.com/). | Tool | Description | | --- | --- | -| [Inventory Report](./fsx_inventory_report) | Creates a report of all the FSxN file systems within an AWS account.| -| [SnapMirror Report](./snapmirror_report) | Creates a report of all SnapMirror relationships within all the FSxN file systems within an AWS account.| +| [Inventory Report](fsx_inventory_report) | Creates a report of all the FSxN file systems within an AWS account.| +| [SnapMirror Report](snapmirror_report) | Creates a report of all SnapMirror relationships within all the FSxN file systems within an AWS account.| +| [Volume Management](Volume_Management) | A collection of playbooks to manage volumes on FSxN file systems.| ## Author Information diff --git a/Infrastructure_as_Code/Ansible/Volume_Management/README.md b/Infrastructure_as_Code/Ansible/Volume_Management/README.md new file mode 100644 index 00000000..db16a995 --- /dev/null +++ b/Infrastructure_as_Code/Ansible/Volume_Management/README.md @@ -0,0 +1,130 @@ +# Ansible Volume Management samples +This folder contains Ansible playbooks that can be used to manage volumes within a FSx for ONTAP file system. + +They have been configured to use the new `use_lambda` feature that allows it to leverage an Workload Factory Link +to issue the API calls to the FSx for ONTAP file system which alleviates the requirement of the Ansible control +node to have network connectivity to the FSx for ONTAP file system. For more information on how to set up a +Workload Factory Link, please refer to the [NetApp Workload Factory documentation](https://docs.netapp.com/us-en/workload-fsx-ontap/links-overview.html). + +The list of playbooks included in this folder is as follows: +- create\_volume.yaml +- delete\_volume.yaml +- create\_snapshot.yaml +- delete\_snapshot.yaml + +## Requirements +- Ansible 2.9 or later. Installation instructions can be found [here](https://docs.ansible.com/ansible/latest/installation_guide/index.html) +- NetApp ONTAP Ansible collection. +- AWS Ansible collection. +- An AWS secret with the credentials necessary to run the required volume APIs against the FSx for ONTAP file system. The required format of the secret is described below. + +## Configuration +Each playbook requires various variables to be set in order to run. +| Variable | Used By Playbook | Required | Default | Description | +|:-------- |:----------------:|:--------:|:-------:|:-----------| +| fsxn\_hostname| All | Yes | None | The hostname, or IP address, of the FSxN where the volume resides.| +| vserver | All | Yes | None | The name of the vserver where the volume resides.| +| secret\_name | All | Yes | None | The name of the AWS secret that contains the credentials to authenticate with the FSx for ONTAP file system.| +| volume\_name| All | Yes | None | The name of the volume you want to act on.| +| lambda\_function\_name| All | No | None | The name of the Workload Factory Link Lambda function to use when issuing API calls to the FSx for ONTAP file system.| +| aws\_region | All | No | None | The AWS region where the Lambda function resides.| +| volume\_size| create\_volume | Yes | None | The size, in MiBs, of the volume to create.| +| security\_style | create\_volume | No | UNIX | The security style to use when creating the volume. Valid options are UNIX or NTFS.| +| aggr | create\_volume | No | aggr1 | The name of the aggregate to create the volume on.| +| volume\_type | create\_volume | No | RW | The type of volume to create. Valid options are RW and DP.| +| junction\_path | create\_volume | No | `/` | The junction path to use when creating the volume.| +| snapshot\_name | create\_snapshot | Yes | None | The name of the snapshot to create.| + +A convenient way to set all the required variable is to put them into a file named `variables.yaml`. +All the playbooks will attempt to load this file and use any variables defined in it. Otherwise, +you can set them by using the `--extra-vars` flag when running the playbook. An example `variables.yaml` +file is included in this folder. + +## Authentication +So that you don't have to hardcode secrets into the playbook, or variable files, all the playbooks +will leverage an AWS Secrets Manager secret to retrieve the credentials for FSx for ONTAP file system. + +Each secret should have two `keys`: +| Key | Value | +| --- |:--- | +| `username` | The username to use to authenticate with the FSx for ONTAP file system. | +| `password` | The password to use to authenticate with the FSx for ONTAP file system. | + +Since this script leverages the AWS Ansible collection you will need to provide authentication credentials for it. +You can read more about how to do that [here](https://docs.ansible.com/ansible/latest/collections/amazon/aws/docsite/aws_ec2_guide.html#authentication). + +## Example Run: +Here is an example of running the `create_volume.yaml` playbook to create a new +volume named `vol1` with a size of 1024 MiBs on the `fsx` vserver: +```bash +$ ansible-playbook create_volume.yaml --extra-vars "volume_name=vol1 volume_size=1024 vserver=fsx" +[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' + +PLAY [Playbook to create a volumes on an FSx for ONTAP file system.] ******************************************************* + +TASK [Ensure required variables are set.] ********************************************************************************** +skipping: [localhost] => (item=volume_name) +skipping: [localhost] => (item=volume_size) +skipping: [localhost] => (item=vserver) +skipping: [localhost] => (item=secret_name) +skipping: [localhost] + +TASK [Set security_style to unix if not provide.] ************************************************************************** +ok: [localhost] + +TASK [Set aggr to 'aggr1' if not provided.] ******************************************************************************** +ok: [localhost] + +TASK [Set volume_type to "rw" if not provided.] **************************************************************************** +ok: [localhost] + +TASK [Set use_lambda to true if lambda_function_name is provided.] ********************************************************* +ok: [localhost] + +TASK [Set aws_provide to "default" if not provided.] *********************************************************************** +ok: [localhost] + +TASK [Set junction path to "/" if not provided.] ************************************************************** +ok: [localhost] + +TASK [Ensure that aws_region has been provided if use_lambda is true.] ***************************************************** +skipping: [localhost] + +TASK [Set aws_region to "" if not set at this point.] ********************************************************************** +skipping: [localhost] + +TASK [Set lambda_function_name to "" if not set at this point.] ************************************************************ +skipping: [localhost] + +TASK [Get username and password from AWS secret.] ************************************************************************** +ok: [localhost] + +TASK [Create the volume] *************************************************************************************************** +changed: [localhost] + +PLAY RECAP ***************************************************************************************************************** +localhost : ok=8 changed=1 unreachable=0 failed=0 skipped=4 rescued=0 ignored=0 +``` + +The above example had a `variables.yaml` file with the following contents: +```yaml +fsxn_hostname: "10.0.0.13" +lambda_function_name: "lambda-8nlmlCR" +aws_region: "us-west-2" +secret_name: "fsxn/default" +``` +## Author Information + +This repository is maintained by the contributors listed on [GitHub](https://github.com/NetApp/FSx-ONTAP-samples-scripts/graphs/contributors). + +## License + +Licensed under the Apache License, Version 2.0 (the "License"). + +You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0). + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an _"AS IS"_ basis, without WARRANTIES or conditions of any kind, either express or implied. + +See the License for the specific language governing permissions and limitations under the License. + +© 2026 NetApp, Inc. All Rights Reserved. diff --git a/Infrastructure_as_Code/Ansible/Volume_Management/create_snapshot.yaml b/Infrastructure_as_Code/Ansible/Volume_Management/create_snapshot.yaml new file mode 100644 index 00000000..707388f7 --- /dev/null +++ b/Infrastructure_as_Code/Ansible/Volume_Management/create_snapshot.yaml @@ -0,0 +1,72 @@ +# Title: snapshot_volume.yaml + +--- +- name: Playbook to create a snapshot on a volume on an FSx for ONTAP file system. + hosts: localhost + collections: + - netapp.ontap + - amazon.aws + gather_facts: false + vars: + use_lambda: false + vars_files: + - variables.yaml + + tasks: + - name: Ensure required variables are set. + fail: + msg: "Required variable '{{ item }}' has not been provided." + when: vars[item] is undefined + loop: + - volume_name + - snapshot_name + - vserver + - fsxn_hostname + - secret_name + + - name: Set use_lambda to true if lambda_function_name is provided. + set_fact: + use_lambda: true + when: lambda_function_name is defined + + - name: Set aws_profile to its default value of 'default' if not provided. + set_fact: + aws_profile: "default" + when: aws_profile is not defined + + - name: Ensure that aws_region has been provided if use_lambda is true. + fail: + msg: "aws_region must be defined when use_lambda is true." + when: use_lambda and aws_region is not defined + + - name: Set aws_region to "" if not set at this point. + set_fact: + aws_region: "" + when: aws_region is not defined + + - name: Set lambda_function_name to "" if not set at this point. + set_fact: + lambda_function_name: "" + when: lambda_function_name is not defined + + - name: Get username and password from AWS secret + set_fact: + username: "{{ lookup('amazon.aws.aws_secret', '{{ secret_name }}.username', nested=true) }}" + password: "{{ lookup('amazon.aws.aws_secret', '{{ secret_name }}.password', nested=true) }}" + no_log: true + + - name: Create snapshot on volume + netapp.ontap.na_ontap_snapshot: + state: present + volume: "{{ volume_name }}" + vserver: "{{ vserver }}" + snapshot: "{{ snapshot_name }}" + use_lambda: "{{ use_lambda }}" + lambda_config: + aws_profile: "{{ aws_profile }}" + aws_region: "{{ aws_region }}" + function_name: "{{ lambda_function_name }}" + hostname: "{{ fsxn_hostname }}" + username: "{{ username }}" + password: "{{ password }}" + validate_certs: false diff --git a/Infrastructure_as_Code/Ansible/Volume_Management/create_volume.yaml b/Infrastructure_as_Code/Ansible/Volume_Management/create_volume.yaml new file mode 100644 index 00000000..451139a7 --- /dev/null +++ b/Infrastructure_as_Code/Ansible/Volume_Management/create_volume.yaml @@ -0,0 +1,96 @@ +# Title: create_volume.yaml + +--- +- name: Playbook to create a volumes on an FSx for ONTAP file system. + hosts: localhost + collections: + - netapp.ontap + - amazon.aws + gather_facts: false + vars_files: + - variables.yaml + vars: + use_lambda: false + + tasks: + - name: Ensure required variables are set. + fail: + msg: "Required variable {{item}} has not been provided." + when: vars[item] is undefined + loop: + - volume_name + - volume_size + - vserver + - secret_name + # + # Give default values to optional variables if they are not defined + - name: Set security_style to unix if not provide. + set_fact: + security_style: "unix" + when: security_style is not defined + + - name: Set aggr to 'aggr1' if not provided. + set_fact: + aggr: "aggr1" + when: aggr is not defined + + - name: Set volume_type to "rw" if not provided. + set_fact: + volume_type: "rw" + when: volume_type is not defined + + - name: Set use_lambda to true if lambda_function_name is provided. + set_fact: + use_lambda: true + when: lambda_function_name is defined + + - name: Set aws_provide to "default" if not provided. + set_fact: + aws_profile: "default" + when: aws_profile is not defined + + - name: Set junction path to "/" if not provided. + set_fact: + junction_path: "/{{ volume_name }}" + when: junction_path is not defined + + - name: Ensure that aws_region has been provided if use_lambda is true. + fail: + msg: "aws_region must be defined when use_lambda is true." + when: use_lambda and aws_region is not defined + + - name: Set aws_region to "" if not set at this point. + set_fact: + aws_region: "" + when: aws_region is not defined + + - name: Set lambda_function_name to "" if not set at this point. + set_fact: + lambda_function_name: "" + when: lambda_function_name is not defined + + - name: Get username and password from AWS secret. + set_fact: + username: "{{ lookup('amazon.aws.aws_secret', '{{ secret_name }}.username', nested=true) }}" + password: "{{ lookup('amazon.aws.aws_secret', '{{ secret_name }}.password', nested=true) }}" + no_log: true + + - name: Create the volume + netapp.ontap.na_ontap_volume: + state: present + name: "{{ volume_name }}" + size: "{{ volume_size }}" + vserver: "{{ vserver }}" + aggregate_name: "{{ aggr }}" + junction_path: "{{ junction_path }}" + use_lambda: "{{ use_lambda }}" + lambda_config: + aws_profile: "{{ aws_profile }}" + aws_region: "{{ aws_region }}" + function_name: "{{ lambda_function_name }}" + type: "{{ volume_type }}" + size_unit: "mb" + hostname: "{{ fsxn_hostname }}" + username: "{{ username }}" + password: "{{ password }}" + validate_certs: false diff --git a/Infrastructure_as_Code/Ansible/Volume_Management/delete_snapshot.yaml b/Infrastructure_as_Code/Ansible/Volume_Management/delete_snapshot.yaml new file mode 100644 index 00000000..90a2e6e5 --- /dev/null +++ b/Infrastructure_as_Code/Ansible/Volume_Management/delete_snapshot.yaml @@ -0,0 +1,72 @@ +# Title: delete_snapshot.yaml + +--- +- name: Playbook to delete a snapshot from a volume on an FSx for ONTAP file system. + hosts: localhost + collections: + - netapp.ontap + - amazon.aws + gather_facts: false + vars: + use_lambda: false + vars_files: + - variables.yaml + + tasks: + - name: Ensure required variables are set. + fail: + msg: "Required variable '{{ item }}' has not been provided." + when: vars[item] is undefined + loop: + - volume_name + - snapshot_name + - vserver + - fsxn_hostname + - secret_name + + - name: Set use_lambda to true if lambda_function_name is provided. + set_fact: + use_lambda: true + when: lambda_function_name is defined + + - name: Set aws_profile to its default value of 'default' if not provided. + set_fact: + aws_profile: "default" + when: aws_profile is not defined + + - name: Ensure that aws_region has been provided if use_lambda is true. + fail: + msg: "aws_region must be defined when use_lambda is true." + when: use_lambda and aws_region is not defined + + - name: Set aws_region to "" if not set at this point. + set_fact: + aws_region: "" + when: aws_region is not defined + + - name: Set lambda_function_name to "" if not set at this point. + set_fact: + lambda_function_name: "" + when: lambda_function_name is not defined + + - name: Get username and password from AWS secret + set_fact: + username: "{{ lookup('amazon.aws.aws_secret', '{{ secret_name }}.username', nested=true) }}" + password: "{{ lookup('amazon.aws.aws_secret', '{{ secret_name }}.password', nested=true) }}" + no_log: true + + - name: Create snapshot on volume + netapp.ontap.na_ontap_snapshot: + state: absent + volume: "{{ volume_name }}" + vserver: "{{ vserver }}" + snapshot: "{{ snapshot_name }}" + use_lambda: "{{ use_lambda }}" + lambda_config: + aws_profile: "{{ aws_profile }}" + aws_region: "{{ aws_region }}" + function_name: "{{ lambda_function_name }}" + hostname: "{{ fsxn_hostname }}" + username: "{{ username }}" + password: "{{ password }}" + validate_certs: false diff --git a/Infrastructure_as_Code/Ansible/Volume_Management/delete_volume.yaml b/Infrastructure_as_Code/Ansible/Volume_Management/delete_volume.yaml new file mode 100644 index 00000000..83f29331 --- /dev/null +++ b/Infrastructure_as_Code/Ansible/Volume_Management/delete_volume.yaml @@ -0,0 +1,70 @@ +# Title: delete_volume.yaml + +--- +- name: Playbook to delete a volume on an FSx for ONTAP file system. + hosts: localhost + collections: + - netapp.ontap + - amazon.aws + gather_facts: false + vars: + use_lambda: false + vars_files: + - variables.yaml + + tasks: + - name: Ensure required variables are set. + fail: + msg: "Required variable {{item}} has not been provided." + when: vars[item] is undefined + loop: + - volume_name + - vserver + - fsxn_hostname + - secret_name + + - name: Set use_lambda to true if lambda_function_name is provided. + set_fact: + use_lambda: true + when: lambda_function_name is defined + + - name: Set aws_profile to its default value of 'default' if not provided. + set_fact: + aws_profile: "default" + when: aws_profile is not defined + + - name: Ensure that aws_region has been provided if use_lambda is true. + fail: + msg: "aws_region must be defined when use_lambda is true." + when: use_lambda and aws_region is not defined + + - name: Set aws_region to "" if not set at this point. + set_fact: + aws_region: "" + when: aws_region is not defined + + - name: Set lambda_function_name to "" if not set at this point. + set_fact: + lambda_function_name: "" + when: lambda_function_name is not defined + + - name: Get username and password from AWS secret + set_fact: + username: "{{ lookup('amazon.aws.aws_secret', '{{ secret_name }}.username', nested=true) }}" + password: "{{ lookup('amazon.aws.aws_secret', '{{ secret_name }}.password', nested=true) }}" + no_log: true + + - name: Delete the volume + netapp.ontap.na_ontap_volume: + state: absent + name: "{{ volume_name }}" + vserver: "{{ vserver }}" + use_lambda: "{{ use_lambda }}" + lambda_config: + aws_profile: "{{ aws_profile }}" + aws_region: "{{ aws_region }}" + function_name: "{{ lambda_function_name }}" + hostname: "{{ fsxn_hostname }}" + username: "{{ username }}" + password: "{{ password }}" + validate_certs: false diff --git a/Infrastructure_as_Code/Ansible/Volume_Management/variables.yaml b/Infrastructure_as_Code/Ansible/Volume_Management/variables.yaml new file mode 100644 index 00000000..62016e8c --- /dev/null +++ b/Infrastructure_as_Code/Ansible/Volume_Management/variables.yaml @@ -0,0 +1,8 @@ +volume_name: "vol1" +volume_size: 100 +vserver: "fsx" +fsxn_hostname: "10.0.0.13" +lambda_function_name: "lambda-8nlmlCR" +aws_region: "us-west-2" +secret_name: "fsxn/default" +snapshot_name: "snapshot1" diff --git a/Ansible/fsx_inventory_report/README.md b/Infrastructure_as_Code/Ansible/fsx_inventory_report/README.md similarity index 100% rename from Ansible/fsx_inventory_report/README.md rename to Infrastructure_as_Code/Ansible/fsx_inventory_report/README.md diff --git a/Ansible/fsx_inventory_report/generate_report.yaml b/Infrastructure_as_Code/Ansible/fsx_inventory_report/generate_report.yaml similarity index 100% rename from Ansible/fsx_inventory_report/generate_report.yaml rename to Infrastructure_as_Code/Ansible/fsx_inventory_report/generate_report.yaml diff --git a/Ansible/fsx_inventory_report/get_fsxn_regions.yaml b/Infrastructure_as_Code/Ansible/fsx_inventory_report/get_fsxn_regions.yaml similarity index 100% rename from Ansible/fsx_inventory_report/get_fsxn_regions.yaml rename to Infrastructure_as_Code/Ansible/fsx_inventory_report/get_fsxn_regions.yaml diff --git a/Ansible/fsx_inventory_report/process_region.yaml b/Infrastructure_as_Code/Ansible/fsx_inventory_report/process_region.yaml similarity index 100% rename from Ansible/fsx_inventory_report/process_region.yaml rename to Infrastructure_as_Code/Ansible/fsx_inventory_report/process_region.yaml diff --git a/Ansible/snapmirror_report/README.md b/Infrastructure_as_Code/Ansible/snapmirror_report/README.md similarity index 81% rename from Ansible/snapmirror_report/README.md rename to Infrastructure_as_Code/Ansible/snapmirror_report/README.md index 3e15f946..1d5e32ee 100644 --- a/Ansible/snapmirror_report/README.md +++ b/Infrastructure_as_Code/Ansible/snapmirror_report/README.md @@ -15,18 +15,20 @@ the number of hours. If the letter is 'M' then the number before it represents t the number before it represents the number of seconds. For example, 'P1DT2H3M4S' represents 1 day, 2 hours, 3 minutes, and 4 seconds. ## Requirements -- jq - A lightweight and flexible command-line JSON processor. Installation instructions can be found [here](https://jqlang.github.io/jq/download/) - Ansible 2.9 or later. Installation instructions can be found [here](https://docs.ansible.com/ansible/latest/installation_guide/index.html) -- AWS Ansible collection. This should be included with the base installation of Ansible. +- NetApp ONTAP Ansible collection. +- AWS Ansible collection. - AWS secret(s) with the credentials necessary to run SnapMirror ONTAP APIs against the FSx for ONTAP file systems. The required format of the secret is described below. +- The `aws` cli installed and configured. Installation instructions can be found [here](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html). This is required to get all the FSxNs within a region, since there isn't an AWS Ansible module that can do that. +- A file with a list of the FSx for ONTAP file systems and their corresponding secrets. The format of the file is described below. ## Installation -There are three files used to create the report: -- `generate_report.yaml`: The Ansible playbook that generates the report. -- `processs_region.yaml`: A collection of tasks that will process all the FSxNs in a region. -- `get_all_fsxn_regions.yaml`: A collection of tasks that retrieves all the regions, that are enabled for the account, where FSx for ONTAP is available. +There are three components to this playbook: +- `generate_report.yaml`: The main Ansible playbook that calls the other files. +- `get_all_fsxn_regions.yaml`: A collection of tasks that retrieves all the regions, that are enabled for the account, where FSx for ONTAP is also available. +- `processs_region.yaml`: A collection of tasks that will process all the FSxNs within a region. -You will also need to create a file named (by default) `secrets_list.csv` that list the secret name for each FSx file systems. +You will also need to create a file named (by default) `secrets.csv` that list the secret name for each FSx file systems. The format of the file should be: ``` file_system_id,secret_name @@ -69,4 +71,4 @@ Unless required by applicable law or agreed to in writing, software distributed See the License for the specific language governing permissions and limitations under the License. -© 2024 NetApp, Inc. All Rights Reserved. +© 2026 NetApp, Inc. All Rights Reserved. diff --git a/Infrastructure_as_Code/Ansible/snapmirror_report/generate_report.yaml b/Infrastructure_as_Code/Ansible/snapmirror_report/generate_report.yaml new file mode 100644 index 00000000..ca13e033 --- /dev/null +++ b/Infrastructure_as_Code/Ansible/snapmirror_report/generate_report.yaml @@ -0,0 +1,66 @@ +################################################################################# +# This Ansible playbook generates a csv file that contains the following +# information for each SnapMirror relationship in all of the FSxNs in all +# of the AWS regions: +# +# FilesystemID +# source +# destination +# state +# healthy +# lag_time +# +# This playbook is dependent on the 'aws' cli being installed and configured +# (i.e. authenticated.) It is need to list all the FSxNs within a region +# since there isn't an amazon.aws.fsx_info module that can do that. +# +# It is also dependent on a csv file that should contain the AWS +# secret for each FSxNs. The format of the secrets.csv file is as follows: +# +# FilesystemID,serect_name +# +# Each secret should have two keys 'username' and 'password'. +# +# The name of the file is set vai the "secrets_list_file" variable below. +# +# It is assumed that all secrets will be in the same region, which is defined +# in the secrets_region variable below. +# +# The output of the playbook is a CSV file that contains the following columns: +# +# fs,source,destination,state,healthy,lag_time +# +################################################################################# +--- +- vars: + report_name: output.csv + secrets_list_file: secrets.csv + secrets_region: us-west-2 +################################################################################# +# +# Don't change anything below this line. +# +################################################################################# + fsxn_regions: [] + opted_in_regions: [] + + name: Playbook to generate a SnapMirror report on all the FSxNs. + hosts: localhost + collections: + - amazon.aws + - netapp.ontap + gather_facts: false + + tasks: + - name: Delete previous report while adding the header line. + ansible.builtin.shell: + cmd: echo fs,source,destination,state,healthy,lag_time > {{ report_name }} + + - name: Get all the regions that support FSxN that are opted into. + include_tasks: get_fsxn_regions.yaml + + - name: Generate the report for all the FSxNs. + include_tasks: process_region.yaml + loop: "{{ fsxn_regions }}" + loop_control: + loop_var: region diff --git a/Ansible/snapmirror_report/get_fsxn_regions.yaml b/Infrastructure_as_Code/Ansible/snapmirror_report/get_fsxn_regions.yaml similarity index 78% rename from Ansible/snapmirror_report/get_fsxn_regions.yaml rename to Infrastructure_as_Code/Ansible/snapmirror_report/get_fsxn_regions.yaml index 06270dfc..7086cbb7 100644 --- a/Ansible/snapmirror_report/get_fsxn_regions.yaml +++ b/Infrastructure_as_Code/Ansible/snapmirror_report/get_fsxn_regions.yaml @@ -1,7 +1,8 @@ -# -# These tasks are used to set a variable named 'fsnx_regions' that contains a -# list of regions that support FSxN and are opted-in. ################################################################################ +# This Ansiable playbook it used to return all of the regions that support FSxN +# and are opted-in. It stores the list of regions in the fsxn_regions variable. +################################################################################ +# - name: Get all the opted-in regions amazon.aws.aws_region_info: register: region_info diff --git a/Infrastructure_as_Code/Ansible/snapmirror_report/process_region.yaml b/Infrastructure_as_Code/Ansible/snapmirror_report/process_region.yaml new file mode 100644 index 00000000..b2afe78c --- /dev/null +++ b/Infrastructure_as_Code/Ansible/snapmirror_report/process_region.yaml @@ -0,0 +1,51 @@ +################################################################################ +# Since Ansible can't handle nested loops, this is a block of tasks that is run +# for each region. It assumes that the calling playbook used 'region' as its +# loop variable. +# +# It gathers all the snapmirror information for all the FSxNs with a region +# that a secret is defined for in the secrets.csv file. Once it has gathered +# all the information, it writes it to an output.csv file in the format: +# +# source_cluster::source_path,destination_cluster::destination_path,state,healthy,lag_time +# +################################################################################ +--- +- name: + debug: + msg: "Processing region {{ region }}" + +- name: Get all the FSxNs for the specified region. + ansible.builtin.shell: + cmd: aws fsx describe-file-systems --region {{ region }} --query 'FileSystems[*].{ID:FileSystemId,IP:OntapConfiguration.Endpoints.Management.IpAddresses[0]}' --output text | sed -e '/^$/d' + register: fsxn_ids_per_region + +- name: Get the SnapMirror relationships for each FSxN. + when: secret != 'n/a' + netapp.ontap.na_ontap_rest_info: + username: "{{ lookup('amazon.aws.aws_secret', '{{ secret }}.username', region=secrets_region, nested=true, on_missing='skip') }}" + password: "{{ lookup('amazon.aws.aws_secret', '{{ secret }}.password', region=secrets_region, nested=true, on_missing='skip') }}" + hostname: "{{ item.split('\t')[1] }}" + validate_certs: false + fields: + - source + - destination + - healthy + - lag_time + - state + gather_subset: + - snapmirror/relationships + loop: "{{ fsxn_ids_per_region.stdout_lines }}" + register: snapmirror_relationships + vars: + secret: "{{ lookup('ansible.builtin.csvfile', item.split('\t')[0], file=secrets_list_file, delimiter=',', default='n/a') }}" + +- name: Write the SnapMirror relationship infor to a file. + ansible.builtin.lineinfile: + insertafter: EOF + path: output.csv + line: "{{ item.source.cluster.name }}::{{ item.source.path }},{{ item.destination.cluster.name }}::{{ item.destination.path }},{{ item.state }},{{ item.healthy }},{{ lag_time }}" + loop: "{{ snapmirror_relationships.results[0].ontap_info['snapmirror/relationships'].records }}" + when: snapmirror_relationships.results | length > 0 and snapmirror_relationships.results[0].ontap_info is defined + vars: + lag_time: "{{ item.lag_time if item.lag_time is defined else 'n/a' }}" diff --git a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/README.md b/Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/README.md similarity index 100% rename from CloudFormation/NetApp-FSxN-Custom-Resources-Samples/README.md rename to Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/README.md diff --git a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_clone.yaml b/Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_clone.yaml similarity index 100% rename from CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_clone.yaml rename to Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_clone.yaml diff --git a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_export_policy.yaml b/Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_export_policy.yaml similarity index 100% rename from CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_export_policy.yaml rename to Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_export_policy.yaml diff --git a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_sm_with_peering.yaml b/Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_sm_with_peering.yaml similarity index 100% rename from CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_sm_with_peering.yaml rename to Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_sm_with_peering.yaml diff --git a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_sm_without_peering.yaml b/Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_sm_without_peering.yaml similarity index 100% rename from CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_sm_without_peering.yaml rename to Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_sm_without_peering.yaml diff --git a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_snapshot.yaml b/Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_snapshot.yaml similarity index 100% rename from CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_snapshot.yaml rename to Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_snapshot.yaml diff --git a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_volume.yaml b/Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_volume.yaml similarity index 100% rename from CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_volume.yaml rename to Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/create_volume.yaml diff --git a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/README.md b/Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/README.md similarity index 100% rename from CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/README.md rename to Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/README.md diff --git a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/activate_extensions b/Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/activate_extensions similarity index 100% rename from CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/activate_extensions rename to Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/activate_extensions diff --git a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/createClone.py b/Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/createClone.py similarity index 100% rename from CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/createClone.py rename to Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/createClone.py diff --git a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_SM_relationship b/Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_SM_relationship similarity index 100% rename from CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_SM_relationship rename to Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_SM_relationship diff --git a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_clone b/Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_clone similarity index 100% rename from CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_clone rename to Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_clone diff --git a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_export_policy b/Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_export_policy similarity index 100% rename from CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_export_policy rename to Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_export_policy diff --git a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_snapshot b/Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_snapshot similarity index 100% rename from CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_snapshot rename to Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_snapshot diff --git a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_volume b/Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_volume similarity index 100% rename from CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_volume rename to Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_volume diff --git a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/deactivate_extensions b/Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/deactivate_extensions similarity index 100% rename from CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/deactivate_extensions rename to Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/deactivate_extensions diff --git a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/deploy_link b/Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/deploy_link similarity index 100% rename from CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/deploy_link rename to Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/deploy_link diff --git a/CloudFormation/README.md b/Infrastructure_as_Code/CloudFormation/README.md similarity index 100% rename from CloudFormation/README.md rename to Infrastructure_as_Code/CloudFormation/README.md diff --git a/CloudFormation/deploy-fsx-ontap/README.md b/Infrastructure_as_Code/CloudFormation/deploy-fsx-ontap/README.md similarity index 100% rename from CloudFormation/deploy-fsx-ontap/README.md rename to Infrastructure_as_Code/CloudFormation/deploy-fsx-ontap/README.md diff --git a/CloudFormation/deploy-fsx-ontap/images/create_stack-01.png b/Infrastructure_as_Code/CloudFormation/deploy-fsx-ontap/images/create_stack-01.png similarity index 100% rename from CloudFormation/deploy-fsx-ontap/images/create_stack-01.png rename to Infrastructure_as_Code/CloudFormation/deploy-fsx-ontap/images/create_stack-01.png diff --git a/CloudFormation/deploy-fsx-ontap/images/create_stack-02.png b/Infrastructure_as_Code/CloudFormation/deploy-fsx-ontap/images/create_stack-02.png similarity index 100% rename from CloudFormation/deploy-fsx-ontap/images/create_stack-02.png rename to Infrastructure_as_Code/CloudFormation/deploy-fsx-ontap/images/create_stack-02.png diff --git a/CloudFormation/deploy-fsx-ontap/images/create_stack-03.png b/Infrastructure_as_Code/CloudFormation/deploy-fsx-ontap/images/create_stack-03.png similarity index 100% rename from CloudFormation/deploy-fsx-ontap/images/create_stack-03.png rename to Infrastructure_as_Code/CloudFormation/deploy-fsx-ontap/images/create_stack-03.png diff --git a/CloudFormation/deploy-fsx-ontap/template.yaml b/Infrastructure_as_Code/CloudFormation/deploy-fsx-ontap/template.yaml similarity index 100% rename from CloudFormation/deploy-fsx-ontap/template.yaml rename to Infrastructure_as_Code/CloudFormation/deploy-fsx-ontap/template.yaml diff --git a/Infrastructure_as_Code/README.md b/Infrastructure_as_Code/README.md new file mode 100644 index 00000000..ca49ec58 --- /dev/null +++ b/Infrastructure_as_Code/README.md @@ -0,0 +1,33 @@ +# Infrastructure as Code + +This folder contains code samples and automation scripts for FSx for NetApp ONTAP operations using the various Infrastructure as Code (IAC) tools. + +* [Ansible](Ansible) + * [FSx ONTAP inventory report](Ansible/fsx_inventory_report) + * [SnapMirror report](Ansible/snapmirror_report) + * [Volume Management](Ansible/Volume_Management) +* [CloudFormation](CloudFormation) + * [NetApp-FSxN-Custom-Resources-Samples](CloudFormation/NetApp-FSxN-Custom-Resources-Samples) + * [deploy-fsx-ontap](CloudFormation/deploy-fsx-ontap) +* [Terraform](Terraform) + * [FSx ONTAP deployment using Terraform](Terraform/deploy-fsx-ontap) + * [FSx ONTAP Replication](Terraform/fsxn-replicate) + * [Deployment of SQL Server on EC2 with FSx ONTAP](Terraform/deploy-fsx-ontap-sqlserver) + * [Deployment of FSx ONTAP with VPN for File Share Access](Terraform/deploy-fsx-ontap-fileshare-access) + +## Author Information + +This repository is maintained by the contributors listed on [GitHub](https://github.com/NetApp/FSx-ONTAP-samples-scripts/graphs/contributors). + +## License + +Licensed under the Apache License, Version 2.0 (the "License"). + +You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0). + +Unless required by applicable law or agreed to in writing, software distributed under the License +is distributed on an _"AS IS"_ basis, without WARRANTIES or conditions of any kind, either express or implied. + +See the License for the specific language governing permissions and limitations under the License. + +© 2024 NetApp, Inc. All Rights Reserved. diff --git a/Terraform/README.md b/Infrastructure_as_Code/Terraform/README.md similarity index 57% rename from Terraform/README.md rename to Infrastructure_as_Code/Terraform/README.md index 61df7447..bcc46e6b 100644 --- a/Terraform/README.md +++ b/Infrastructure_as_Code/Terraform/README.md @@ -3,10 +3,10 @@ This subfolder contains various examples of how you can use Terraform to deploy | Tool | Description | | --- | --- | -| [Deploy FSx ONTAP File Share](/Terraform/deploy-fsx-ontap-fileshare-access) | This sample shows how to deploy an FSx for ONTAP file system and access it from a remote system using OpenVPN. | -| [Deploy FSx ONTAP SQL Server](/Terraform/deploy-fsx-ontap-sqlserver) | This sample shows how to deploy on FSx for ONTAP file system and use it as a shared storage for a SQL Server. | -| [Deploy FSx ONTAP](/Terraform/deploy-fsx-ontap) | This sample shows how to deploy an FSx for ONTAP file system using Terraform. | -| [FSx ONTAP Replicate](/Terraform/fsxn-replicate)| This sample shows how to use Terraform to replicate an FSx for ONTAP file system for disaster recovery purposes. | +| [Deploy FSx ONTAP File Share](deploy-fsx-ontap-fileshare-access) | This sample shows how to deploy an FSx for ONTAP file system and access it from a remote system using OpenVPN. | +| [Deploy FSx ONTAP SQL Server](deploy-fsx-ontap-sqlserver) | This sample shows how to deploy on FSx for ONTAP file system and use it as a shared storage for a SQL Server. | +| [Deploy FSx ONTAP](deploy-fsx-ontap) | This sample shows how to deploy an FSx for ONTAP file system using Terraform. | +| [FSx ONTAP Replicate](fsxn-replicate)| This sample shows how to use Terraform to replicate an FSx for ONTAP file system for disaster recovery purposes. | ## Author Information diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/README.md b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/README.md similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/README.md rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/README.md diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/images/EC2-AD-Check.png b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/images/EC2-AD-Check.png similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/images/EC2-AD-Check.png rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/images/EC2-AD-Check.png diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/images/FSxN+ClientVPN.png b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/images/FSxN+ClientVPN.png similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/images/FSxN+ClientVPN.png rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/images/FSxN+ClientVPN.png diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/images/FSxN-AD-Check.png b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/images/FSxN-AD-Check.png similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/images/FSxN-AD-Check.png rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/images/FSxN-AD-Check.png diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/images/FSxN-FS-Check.png b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/images/FSxN-FS-Check.png similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/images/FSxN-FS-Check.png rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/images/FSxN-FS-Check.png diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/images/IAM_Policy.png b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/images/IAM_Policy.png similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/images/IAM_Policy.png rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/images/IAM_Policy.png diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/images/MacOS-Finder-Connect.png b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/images/MacOS-Finder-Connect.png similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/images/MacOS-Finder-Connect.png rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/images/MacOS-Finder-Connect.png diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/images/VPN-Client-Setup.png b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/images/VPN-Client-Setup.png similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/images/VPN-Client-Setup.png rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/images/VPN-Client-Setup.png diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/main.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/main.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/main.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/main.tf diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/ec2ad/ec2-ad.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/ec2ad/ec2-ad.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/ec2ad/ec2-ad.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/ec2ad/ec2-ad.tf diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/ec2ad/ec2-ami.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/ec2ad/ec2-ami.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/ec2ad/ec2-ami.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/ec2ad/ec2-ami.tf diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/ec2ad/outputs.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/ec2ad/outputs.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/ec2ad/outputs.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/ec2ad/outputs.tf diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/ec2ad/variables.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/ec2ad/variables.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/ec2ad/variables.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/ec2ad/variables.tf diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/fsxn/fsx-fs.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/fsxn/fsx-fs.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/fsxn/fsx-fs.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/fsxn/fsx-fs.tf diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/fsxn/fsx-svm.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/fsxn/fsx-svm.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/fsxn/fsx-svm.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/fsxn/fsx-svm.tf diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/fsxn/fsx-volume.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/fsxn/fsx-volume.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/fsxn/fsx-volume.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/fsxn/fsx-volume.tf diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/fsxn/outputs.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/fsxn/outputs.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/fsxn/outputs.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/fsxn/outputs.tf diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/fsxn/variables.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/fsxn/variables.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/fsxn/variables.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/fsxn/variables.tf diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/README.md b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/README.md similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/README.md rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/README.md diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/README.md b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/README.md similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/README.md rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/README.md diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/ca.crt b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/ca.crt similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/ca.crt rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/ca.crt diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/ca.pem b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/ca.pem similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/ca.pem rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/ca.pem diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/client.fsxn.crt b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/client.fsxn.crt similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/client.fsxn.crt rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/client.fsxn.crt diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/client.fsxn.key b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/client.fsxn.key similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/client.fsxn.key rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/client.fsxn.key diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/client.fsxn.pem b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/client.fsxn.pem similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/client.fsxn.pem rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/client.fsxn.pem diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/server.crt b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/server.crt similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/server.crt rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/server.crt diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/server.fsxn.crt b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/server.fsxn.crt similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/server.fsxn.crt rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/server.fsxn.crt diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/server.fsxn.key b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/server.fsxn.key similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/server.fsxn.key rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/server.fsxn.key diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/server.fsxn.pem b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/server.fsxn.pem similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/server.fsxn.pem rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/server.fsxn.pem diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/server.key b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/server.key similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/server.key rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/certs/server.key diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/main.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/main.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/main.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/main.tf diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/securitygroups.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/securitygroups.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/securitygroups.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/securitygroups.tf diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/variables.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/variables.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/variables.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/variables.tf diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/networking.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/networking.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/networking.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/networking.tf diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/outputs.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/outputs.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/outputs.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/outputs.tf diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/ssm.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/ssm.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/ssm.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/ssm.tf diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/terraform.sample.tfvars b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/terraform.sample.tfvars similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/terraform.sample.tfvars rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/terraform.sample.tfvars diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/variables.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/variables.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-fileshare-access/variables.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access/variables.tf diff --git a/Terraform/deploy-fsx-ontap-sqlserver/README.md b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/README.md similarity index 100% rename from Terraform/deploy-fsx-ontap-sqlserver/README.md rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/README.md diff --git a/Terraform/deploy-fsx-ontap-sqlserver/main.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/main.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-sqlserver/main.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/main.tf diff --git a/Terraform/deploy-fsx-ontap-sqlserver/modules/ec2/ec2-ami.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/modules/ec2/ec2-ami.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-sqlserver/modules/ec2/ec2-ami.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/modules/ec2/ec2-ami.tf diff --git a/Terraform/deploy-fsx-ontap-sqlserver/modules/ec2/ec2-sql.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/modules/ec2/ec2-sql.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-sqlserver/modules/ec2/ec2-sql.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/modules/ec2/ec2-sql.tf diff --git a/Terraform/deploy-fsx-ontap-sqlserver/modules/ec2/outputs.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/modules/ec2/outputs.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-sqlserver/modules/ec2/outputs.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/modules/ec2/outputs.tf diff --git a/Terraform/deploy-fsx-ontap-sqlserver/modules/ec2/variables.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/modules/ec2/variables.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-sqlserver/modules/ec2/variables.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/modules/ec2/variables.tf diff --git a/Terraform/deploy-fsx-ontap-sqlserver/modules/fsxn/fsx-fs.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/modules/fsxn/fsx-fs.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-sqlserver/modules/fsxn/fsx-fs.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/modules/fsxn/fsx-fs.tf diff --git a/Terraform/deploy-fsx-ontap-sqlserver/modules/fsxn/fsx-svm.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/modules/fsxn/fsx-svm.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-sqlserver/modules/fsxn/fsx-svm.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/modules/fsxn/fsx-svm.tf diff --git a/Terraform/deploy-fsx-ontap-sqlserver/modules/fsxn/fsx-volume.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/modules/fsxn/fsx-volume.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-sqlserver/modules/fsxn/fsx-volume.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/modules/fsxn/fsx-volume.tf diff --git a/Terraform/deploy-fsx-ontap-sqlserver/modules/fsxn/outputs.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/modules/fsxn/outputs.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-sqlserver/modules/fsxn/outputs.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/modules/fsxn/outputs.tf diff --git a/Terraform/deploy-fsx-ontap-sqlserver/modules/fsxn/variables.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/modules/fsxn/variables.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-sqlserver/modules/fsxn/variables.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/modules/fsxn/variables.tf diff --git a/Terraform/deploy-fsx-ontap-sqlserver/networking.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/networking.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-sqlserver/networking.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/networking.tf diff --git a/Terraform/deploy-fsx-ontap-sqlserver/outputs.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/outputs.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-sqlserver/outputs.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/outputs.tf diff --git a/Terraform/deploy-fsx-ontap-sqlserver/ssm.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/ssm.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-sqlserver/ssm.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/ssm.tf diff --git a/Terraform/deploy-fsx-ontap-sqlserver/terraform.sample.tfvars b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/terraform.sample.tfvars similarity index 100% rename from Terraform/deploy-fsx-ontap-sqlserver/terraform.sample.tfvars rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/terraform.sample.tfvars diff --git a/Terraform/deploy-fsx-ontap-sqlserver/variables.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/variables.tf similarity index 100% rename from Terraform/deploy-fsx-ontap-sqlserver/variables.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver/variables.tf diff --git a/Terraform/deploy-fsx-ontap/README.md b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap/README.md similarity index 100% rename from Terraform/deploy-fsx-ontap/README.md rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap/README.md diff --git a/Terraform/deploy-fsx-ontap/module/README.md b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap/module/README.md similarity index 100% rename from Terraform/deploy-fsx-ontap/module/README.md rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap/module/README.md diff --git a/Terraform/deploy-fsx-ontap/module/main.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap/module/main.tf similarity index 100% rename from Terraform/deploy-fsx-ontap/module/main.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap/module/main.tf diff --git a/Terraform/deploy-fsx-ontap/module/output.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap/module/output.tf similarity index 100% rename from Terraform/deploy-fsx-ontap/module/output.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap/module/output.tf diff --git a/Terraform/deploy-fsx-ontap/module/security_groups.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap/module/security_groups.tf similarity index 100% rename from Terraform/deploy-fsx-ontap/module/security_groups.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap/module/security_groups.tf diff --git a/Terraform/deploy-fsx-ontap/module/variables.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap/module/variables.tf similarity index 100% rename from Terraform/deploy-fsx-ontap/module/variables.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap/module/variables.tf diff --git a/Terraform/deploy-fsx-ontap/standalone-module/README.md b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap/standalone-module/README.md similarity index 100% rename from Terraform/deploy-fsx-ontap/standalone-module/README.md rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap/standalone-module/README.md diff --git a/Terraform/deploy-fsx-ontap/standalone-module/main.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap/standalone-module/main.tf similarity index 100% rename from Terraform/deploy-fsx-ontap/standalone-module/main.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap/standalone-module/main.tf diff --git a/Terraform/deploy-fsx-ontap/standalone-module/output.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap/standalone-module/output.tf similarity index 100% rename from Terraform/deploy-fsx-ontap/standalone-module/output.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap/standalone-module/output.tf diff --git a/Terraform/deploy-fsx-ontap/standalone-module/security_groups.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap/standalone-module/security_groups.tf similarity index 100% rename from Terraform/deploy-fsx-ontap/standalone-module/security_groups.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap/standalone-module/security_groups.tf diff --git a/Terraform/deploy-fsx-ontap/standalone-module/variables.tf b/Infrastructure_as_Code/Terraform/deploy-fsx-ontap/standalone-module/variables.tf similarity index 100% rename from Terraform/deploy-fsx-ontap/standalone-module/variables.tf rename to Infrastructure_as_Code/Terraform/deploy-fsx-ontap/standalone-module/variables.tf diff --git a/Terraform/fsxn-replicate/DR_FSxN_variables.tf b/Infrastructure_as_Code/Terraform/fsxn-replicate/DR_FSxN_variables.tf similarity index 100% rename from Terraform/fsxn-replicate/DR_FSxN_variables.tf rename to Infrastructure_as_Code/Terraform/fsxn-replicate/DR_FSxN_variables.tf diff --git a/Terraform/fsxn-replicate/Primary_FSxN_variables.tf b/Infrastructure_as_Code/Terraform/fsxn-replicate/Primary_FSxN_variables.tf similarity index 100% rename from Terraform/fsxn-replicate/Primary_FSxN_variables.tf rename to Infrastructure_as_Code/Terraform/fsxn-replicate/Primary_FSxN_variables.tf diff --git a/Terraform/fsxn-replicate/README.md b/Infrastructure_as_Code/Terraform/fsxn-replicate/README.md similarity index 100% rename from Terraform/fsxn-replicate/README.md rename to Infrastructure_as_Code/Terraform/fsxn-replicate/README.md diff --git a/Terraform/fsxn-replicate/main.tf b/Infrastructure_as_Code/Terraform/fsxn-replicate/main.tf similarity index 100% rename from Terraform/fsxn-replicate/main.tf rename to Infrastructure_as_Code/Terraform/fsxn-replicate/main.tf diff --git a/Terraform/fsxn-replicate/output.tf b/Infrastructure_as_Code/Terraform/fsxn-replicate/output.tf similarity index 100% rename from Terraform/fsxn-replicate/output.tf rename to Infrastructure_as_Code/Terraform/fsxn-replicate/output.tf diff --git a/Terraform/fsxn-replicate/security_groups.tf b/Infrastructure_as_Code/Terraform/fsxn-replicate/security_groups.tf similarity index 100% rename from Terraform/fsxn-replicate/security_groups.tf rename to Infrastructure_as_Code/Terraform/fsxn-replicate/security_groups.tf diff --git a/Terraform/fsxn-replicate/terraform.sample.tfvars b/Infrastructure_as_Code/Terraform/fsxn-replicate/terraform.sample.tfvars similarity index 100% rename from Terraform/fsxn-replicate/terraform.sample.tfvars rename to Infrastructure_as_Code/Terraform/fsxn-replicate/terraform.sample.tfvars diff --git a/Management-Utilities/Workload-Factory-API-Samples/README.md b/Management-Utilities/Workload-Factory-API-Samples/README.md index f147d326..9e6411e5 100644 --- a/Management-Utilities/Workload-Factory-API-Samples/README.md +++ b/Management-Utilities/Workload-Factory-API-Samples/README.md @@ -1,30 +1,39 @@ # Workload Factory API Samples -The idea behind this folder is to show examples of how to use the [BlueXP Workload Factory APIs](https://console.workloads.netapp.com/api-doc). -Not every API is covered, but the ones required to get you started (get a refresh token, get the BlueXP accountID, -get BlueXP credentials ID) are included. Once you have the information provided from these APIs are ready to start +The idea behind this folder is to show examples of how to use the [Workload Factory APIs](https://console.workloads.netapp.com/api-doc). +Not every API is covered, but the ones required to get you started (i.e. get a bearer token, get the BlueXP accountID, +get BlueXP credentials ID) are included. Once you have the information provided from these APIs you are ready to start calling the others. While these examples are implemented as bash shell scripts you should be able to translate them to the programming language that you prefer, such as Python, Go, or JavaScript. -Note that all these scripts depend on the [wf_utils](wf_utils) file that contains common functions used by all the -scripts. One function in particular, `get_token()`, is used to get an authentication token from the BlueXP Workload -Factory API. So, if you copy just some of the files from this repository, make sure to copy the `wf_utils` file as well. +You authenticate to the Workload Factory APIs with a "Bearer Token." You generate a bearer token +by running a specific API using your "Refresh Token." Instructions on how to obtain your "Refresh Token" and generate an bearer token can be found +in the [NetApp Console documentation](https://docs.netapp.com/us-en/bluexp-automation/platform/create_user_token.html#1-generate-a-netapp-refresh-token). +Note that a bearer token expires after 24 hours whereas the Refresh Token does not expire until you revoke it from the NetApp Console. + +Also note that all these scripts depend on the [wf_utils](wf_utils) file that contains common functions used by all of them. +So, if you copy just one of these scripts, make sure to also copy the `wf_utils` file as well. + +To make it easier to run the scripts, a `get_token()` function is included in the `wf_utils` file +that retrieves a bearer token for you. So, you don't have to worry about manually generating a bearer token +everyday instead, you just pass the "Refresh Token" to the scripts, they will call the `get_token()` function and +generate a bearer token for you. ## Prerequisites To run these scripts, you need to have the following prerequisites: -- A bash shell. +- A NetApp Console refresh token. You can generate one by visiting [Refresh Token Generator](https://services.cloud.netapp.com/refresh-token) page and following the instructions there. +- A bash shell. If you want to run from a Windows environment, you can use the Windows Subsystem for Linux (WSL). - The `curl` command-line tool installed. - The `jq` command-line JSON processor installed. You can install it using your package manager, e.g., `apt-get install jq` on Debian/Ubuntu or `brew install jq` on macOS. ## Notes: - All scripts allow you to set environment variables to pass options instead of having to use the -command line options. For example, instead of using the `-t` option to pass the -[BlueXP Refresh Token](https://docs.netapp.com/us-en/bluexp-automation/platform/create_user_token.html#1-generate-a-netapp-refresh-token), +command line options. For example, instead of using the `-t` option to pass the Refresh Token you can set the `REFRESH_TOKEN` environment variable. - All scripts accept the `-h` option to display the help message, which includes the available options and their descriptions. -Hopefully with these samples you'll be able to create your own scripts that use any the Workload Factory APIs. +Hopefully with these samples you'll be able to create your own scripts that use any of the Workload Factory APIs. If you do create a new script, please consider contributing it back to this repository so that others can benefit from it. ## Available Scripts diff --git a/README.md b/README.md index 8e063154..d37d8078 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ built to maximize cost performance, resilience, and accessibility in business-cr This GitHub repository contains comprehensive code samples and automation scripts for FSx for Netapp ONTAP operations, promoting the use of Infrastructure as Code (IAC) tools and encouraging developers to extend the product's functionalities through code. The samples here go alongside the automation, management and monitoring that -[BlueXP Workload Factory](https://console.workloads.netapp.com) provides. +[Workload Factory](https://console.workloads.netapp.com) provides. We welcome contributions from the community! Please read our [contribution guidelines](CONTRIBUTING.md) before getting started. @@ -16,12 +16,19 @@ Have a great idea? We'd love to hear it! Please email us at [ng-fsxn-github-samp ## Table of Contents -* [Anisble](/Ansible) - * [FSx ONTAP inventory report](/Ansible/fsx_inventory_report) - * [SnapMirror report](/Ansible/snapmirror_report) -* [CloudFormation](/CloudFormation) - * [NetApp-FSxN-Custom-Resources-Samples](/CloudFormation/NetApp-FSxN-Custom-Resources-Samples) - * [deploy-fsx-ontap](/CloudFormation/deploy-fsx-ontap) +* [Infrastructure as Code](/Infrastructure_as_Code) + * [Ansible](/Infrastructure_as_Code/Ansible) + * [FSx ONTAP inventory report](/Infrastructure_as_Code/Ansible/fsx_inventory_report) + * [SnapMirror report](/Infrastructure_as_Code/Ansible/snapmirror_report) + * [Volume Management](/Infrastructure_as_Code/Ansible/Volume_Management) + * [CloudFormation](/Infrastructure_as_Code/CloudFormation) + * [NetApp-FSxN-Custom-Resources-Samples](/Infrastructure_as_Code/CloudFormation/NetApp-FSxN-Custom-Resources-Samples) + * [deploy-fsx-ontap](/Infrastructure_as_Code/CloudFormation/deploy-fsx-ontap) + * [Terraform](/Infrastructure_as_Code/Terraform) + * [FSx ONTAP deployment using Terraform](/Infrastructure_as_Code/Terraform/deploy-fsx-ontap) + * [FSx ONTAP Replication](/Infrastructure_as_Code/Terraform/fsxn-replicate) + * [Deployment of SQL Server on EC2 with FSx ONTAP](/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-sqlserver) + * [Deployment of FSx ONTAP with VPN for File Share Access](/Infrastructure_as_Code/Terraform/deploy-fsx-ontap-fileshare-access) * [EKS](/EKS) * [Backup-EKS-Applications-with-Trident-Protect](/EKS/Backup-EKS-Applications-with-Trident-Protect) * [FSx for NetApp ONTAP as persistent storage for EKS](/EKS/FSxN-as-PVC-for-EKS) @@ -43,11 +50,6 @@ Have a great idea? We'd love to hear it! Please email us at [ng-fsxn-github-samp * [Monitor FSx for ONTAP with Harvest on EKS](/Monitoring/monitor_fsxn_with_harvest_on_eks) * [Solutions](/Solutions) * [k8s applications non-stdout logs collection into ELK](/Solutions/EKS-logs-to-ELK) -* [Terraform](/Terraform) - * [FSx ONTAP deployment using Terraform](/Terraform/deploy-fsx-ontap) - * [FSx ONTAP Replication](/Terraform/fsxn-replicate) - * [Deployment of SQL Server on EC2 with FSx ONTAP](/Terraform/deploy-fsx-ontap-sqlserver) - * [Deployment of FSx ONTAP with VPN for File Share Access](/Terraform/deploy-fsx-ontap-fileshare-access) ## Author Information