diff --git a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/README.md b/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/README.md index d9a7d98..7c36978 100644 --- a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/README.md +++ b/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/README.md @@ -56,7 +56,7 @@ Outputs: ``` You can use the above template to create the role by running the following command: ``` -aws cloudformation create-stack --stack-name create_execution_role_for_NetApp_CF_extensions --template-body file:// --capabilities CAPABILITY_NAMED_IAM +aws cloudformation create-stack --stack-name CreateExecutionRoleForNetAppCFextensions --template-body file:// --capabilities CAPABILITY_NAMED_IAM ``` ### Step 2: Activate the Extensions @@ -86,11 +86,30 @@ Where: - `` is the AWS region you want to activate the extensions in. - `,` are the subnet(s) you want to deploy the link in. No spaces between the subnet IDs. Only one is required, but is recommended to have at least two. These subnets must have access to the FSxN management endpoint. -- `,` are the security group that will be attached to the Lambda Link function. +- `,` are the security group(s) that will be attached to the Lambda Link function. +The security groups must allow access to the FSxN management endpoint over port 443. No spaces between the security group IDs. Only one is required. - `` is the name you want to give the link. It is also used as the name assigned to the link Lambda function. -Once you have done this, you are ready to start using the examples in this repository. +### Step 4: Create an AWS Secret Manager Secret +All of the extensions use an AWS Secrets Manager secret to obtain the credentials needed to manage the FSx for ONTAP file system. +The secret should be a JSON object with the one key. The key can be named anything, but the value should be of the form `"username:password"`. +This allows you to use any username you want. If you want to use fsxadmin (the default admin for an FSx for ONTAP file system), then the value can be just that user's password. + +The following command can be used to create a secret: +``` +aws secretsmanager create-secret --name --secret-string '{"":":"}' +``` +Where: +``` + is the name you want to give the secret. + is the name of the key in the secret. It can be anything you want. + is the username you want to use to manage the FSx for ONTAP file system. + is the password for the username. +``` + +## Sample CloudFormation Templates +Once you have done the above steps you are ready to start using the examples in this repository. | File | Description | |------|-------------| diff --git a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/README.md b/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/README.md index 56f8bad..ce346e4 100644 --- a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/README.md +++ b/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/README.md @@ -16,6 +16,24 @@ There are also a couple scripts that can be used to help enable the NetApp FSxN |deploy_link | This script will use CloudFormation to deploy a Workload Factory Link.| |createClone.py | This is a Python script that will create a clone of a volume using boto to deploy a CloudFormation stack that creates a clone.| +## Usage +To run these scripts you'll need to download them, change the permissions to be executable, and then run them. For example: +```bash +chmod +x create_volume +./create_volme -r us-west-2 -l arn:aws:lambda:ca-central-1:759999999999:function:wf-link -s arn:aws:secretsmanager:us-east-1:759999999999:secret:fsnSecret-yyaL32 -f fs-02a89999999999999 -v prod -n vol1 -t ../create_volume.yaml +``` + +To see the required parameters for each script, you can run the script with the `-h` flag. For example: +```bash +./create_volume -h +Usage: create_volume [-r region] -l link_ARN -s secret_ARN [-k secret_key] -f fsx_id -v svm_name -n volune_name [-z size_in_MB] [-a aggregate] -t template +Notes: + The default region is the region configured in the AWS CLI. + The default secret key is 'credentials'. + The default aggregate is "aggr1". + The default size is 20MB. +``` + ## Author Information This repository is maintained by the contributors listed on [GitHub](https://github.com/NetApp/FSx-ONTAP-samples-scripts/graphs/contributors). diff --git a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_SM_relationship b/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_SM_relationship index da97eba..7b854cd 100755 --- a/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_SM_relationship +++ b/CloudFormation/NetApp-FSxN-Custom-Resources-Samples/scripts/create_SM_relationship @@ -12,12 +12,12 @@ ################################################################################ usage () { cat <