Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/terraform-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 }}
Expand All @@ -47,4 +47,4 @@ jobs:
# run: terraform fmt -diff -check -no-color -recursive

- name: Validate Terraform configuration
run: terraform validate
run: terraform validate
File renamed without changes.
32 changes: 32 additions & 0 deletions Infrastructure_as_Code/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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)
* [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.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
29 changes: 19 additions & 10 deletions Management-Utilities/Workload-Factory-API-Samples/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,26 @@ 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.

Have a great idea? We'd love to hear it! Please email us at [ng-fsxn-github-samples@netapp.com](mailto:ng-fsxn-github-samples@netapp.com).

## 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)
* [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)
Expand All @@ -43,11 +49,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

Expand Down
Loading