You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added support to the rotate secrets module to handle updating a SVM password; Allowing the secret to be in a different region than the default; Used friendly variables names.
description="aws region where you want the resources deployed."
2
+
description="The AWS region where you want the resources deployed."
3
+
type=string
4
4
}
5
5
6
6
variable"aws_secrets_region" {
7
-
default="us-west-2"
8
-
description="The region where you want the FSxN secret stored within AWS Secrets Manager."
7
+
description="The AWS region where you want the FSxN and SVM secrets stored within AWS Secrets Manager."
8
+
type=string
9
+
}
10
+
11
+
variable"aws_account_id" {
12
+
description="The AWS account ID. Used to create very specific permissions in the IAM role for the EKS cluster."
13
+
type=string
9
14
}
10
15
11
16
variable"fsx_name" {
12
-
default="eksfs"
13
17
description="The name you want assigned to the FSxN file system."
18
+
default="eksfs"
14
19
}
15
20
16
-
variable"fsx_password_secret_name" {
21
+
variable"secret_name_prefix" {
22
+
description="The base name of the secrets (FSxN and SVM) to create within the AWS Secrets Manager. A random string will be appended to the end of the secreate name to ensure no name conflict."
17
23
default="fsx-eks-secret"
18
-
description="The base name of the secret to create within the AWS Secrets Manager that will contain the FSxN password. A random string will be appended to the end of the secreate name to ensure no name conflict."
19
24
}
20
25
21
26
variable"fsxn_storage_capacity" {
22
-
default=1024
23
27
description="The storage capacity, in GiBs, to be allocated to the FSxN clsuter. Must be at least 1024, and less than 196608."
Copy file name to clipboardExpand all lines: Management-Utilities/fsxn-rotate-secret/README.md
+57-11Lines changed: 57 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,9 @@
1
1
# Rotate FSxN File System Passwords
2
2
3
3
## Introduction
4
-
This sample provides a way to rotate a Secrets Manager secret that is used to manage FSxN file system.
5
-
It is a Lambda function that is expected to be triggered by the Secrets Manager rotation feature.
4
+
This sample provides a way to rotate a Secrets Manager secret that is used to hold the
5
+
password assigned to an FSxN file system or a FSxN Storage Virtual Machine.
6
+
It is a Lambda function that is expected to be invoked by the Secrets Manager rotation feature.
6
7
The Secrets Manager should invoke the function four times, each time with the `stage` field, in the `event` dictionary passed in, set to one of the following values:
7
8
8
9
| Stage | Description |
@@ -28,6 +29,7 @@ relationship with the AWS Lambda service.
28
29
| secretsManager:DescribeSecret|\<secretARN> |\<secretARN> is the AWS ARN of the secret to rotate. |
29
30
| secretsmanager:GetRandomPassword|\*| The scope doesn't matter, since this function doesn't have anything to do with any AWS resources. |
30
31
| fsx:UpdateFileSystem|\<fileSystemARN> |\<fileSystemARN> is the AWS ARN of the FSxN file system to manage. |
32
+
| fsx:UpdateStorageVirtualMachine|\<svmARN> |\<svmARN> is the AWS ARN of the Storage Virtual Machine to manage. |
31
33
| logs:CreateLogGroup| arn:aws:logs:\<region>:\<accountID>:\*| This allows the Lambda function to create a log group in CloudWatch. This is optional but allows you to get diagnostic information from the Lambda function. |
32
34
| logs:CreateLogStream| arn:aws:logs:\<region>:\<accountID>:log-group:/aws/lambda/\<Lambda_function_name>:\*| This allows the Lambda function to create a log stream in CloudWatch. This is optional but allows you to get diagnostic information from the function.|
33
35
| logs:PutLogEvents| arn:aws:logs:\<region>:\<accountID>:log-group:/aws/lambda/\<Lambda_function_name>:\*| This allows the Lambda function to write log events to a log stream in CloudWatch. This is optional but allows you to get diagnostic information from the function.|
@@ -53,11 +55,25 @@ secretsmanager AWS service to invoke the Lambda function. Do that do the followi
53
55
- The principal should already be set to `secretsmanager.amazonaws.com`
54
56
- Set action to `lambda:InvokeFunction`
55
57
56
-
##### Step 2.4 - Enable Secrets Manager Rotation
57
-
To enable rotation of the secret, you will need to go to the Secrets Manager console and
58
-
select the secret you want to rotate. Click on the "Edit rotation" button and select the
59
-
Lambda function you created above. You can also set the rotation schedule to whatever you
60
-
want. The default is 30 days.
58
+
#### Step 3 - Enable Secrets Manager Rotation
59
+
To enable the rotation of the secret, go will need to the Secrets Manager page of the AWS console
60
+
and click on the secret you want to rotate, then:
61
+
##### Step 3.1 - Set the tags
62
+
The way Lambda function knows which FSxN file system, or which SVM, to update the password on is
63
+
via the tags associated with the secret. The following are the tags that the program looks for:
64
+
|Tag Key|Tag Value|Description|
65
+
|:------|:--------|:----------|
66
+
|region|\<region\>|The region the FSxN file system resides in.|
67
+
|fsx_id|\<file-System-id\>|The FSxN file system id.|
0 commit comments