You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Management-Utilities/fsxn-rotate-secret/README.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ The Secrets Manager should invoke the function four times, each time with the `s
7
7
8
8
| Stage | Description |
9
9
|------------|-------------|
10
-
|createSecret|The function will create a new version of the secret with a "Version Staging ID" of "AWSPENDING". At this point the original secret is still be left as is, and will be the default secret returned if no versionStagingID is provided.|
10
+
|createSecret|The function will create a new version of the secret with a "Version Staging ID" of "AWSPENDING". At this point the original secret is still be left as is and will be the default secret returned if no Version Staging ID is provided.|
11
11
|setSecret |The function will update the password for the FSxN file system using the new version of the secret.|
12
12
|testSecret |Currently no testing is performed. The Lambda function would have to be attached to the same VPC as the FSxN file system to test the password. Since that would potentially make it where you'd have to have a separate function for each FSxN deployment, and potentially have to setup AWS Endpoints for AWS services, a decision was made to not do that. If the Lambda function fails to set the password correctly, you can always use the AWS console, or API, to set it to whatever you need.|
13
13
|finishSecret|The function will promote the new password to the "AWSCURRENT" Version Staging ID. This will set the Version Staging ID of the old password to "AWSPREVIOUS".|
@@ -27,10 +27,10 @@ relationship with the AWS Lambda service.
27
27
| secretsManager:UpdateSecretVersionStage|\<secretARN> |\<secretARN> is the AWS ARN of the secret to rotate. |
28
28
| secretsManager:DescribeSecret|\<secretARN> |\<secretARN> is the AWS ARN of the secret to rotate. |
29
29
| secretsmanager:GetRandomPassword|\*| The scope doesn't matter, since this function doesn't have anything to do with any AWS resources. |
30
-
| fsx:UpdateFileSystem|\<fileSystemARN> |\<fileSytemARN> is the AWS ARN of the FSxN file system to manage. |
31
-
| 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
-
| logs:CreateLogStream| arn:aws:logs:\<region>:\<accountID>:log-group:/aws/lambda/\<Lambda_function_name>:\*| This allows the Lambda function to create a log streams in CloudWatch. This is optional, but allows you to get diagnostic information from the function.|
33
-
| 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.|
30
+
| fsx:UpdateFileSystem|\<fileSystemARN> |\<fileSystemARN> is the AWS ARN of the FSxN file system to manage. |
31
+
| 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
+
| 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
+
| 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.|
34
34
35
35
#### Step 2 - Create the Lambda Function
36
36
##### Step 2.1
@@ -43,7 +43,7 @@ Create a Lambda function with the following parameters:
43
43
After you create the function, you will be able to insert the code included with this
44
44
sample into the code box and click "Deployed" to save it.
45
45
46
-
##### Step 2.3 - Change permisisons
46
+
##### Step 2.3 - Change permissisons
47
47
Change to the `Configuration` tab and select `Permissions` and add a `Resource-based policy` statement that will allow the
48
48
secretsmanager AWS service to invoke the Lambda function. Do that do the following:
49
49
@@ -62,9 +62,9 @@ want. The default is 30 days.
62
62
### Terraform Method
63
63
The Terraform module provided in the `terraform` directory can be used to create the Secrets Manager
64
64
secret setup to use a rotation policy that uses the Lambda function. It will create the following resources:
65
-
- Lambda function used to rotate the secret.
66
-
- IAM role that allows the Lambda function to rotate the secret.
67
-
- A Secrets Manager secret with a rotation schedule of 30 days.
65
+
-A Lambda function used to rotate the secret.
66
+
-An IAM role that allows the Lambda function to rotate the secret.
67
+
- A Secrets Manager secret with a rotation enabled.
0 commit comments