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
This solution provides a CloudFormation template to deploy an AWS CloudWatch dashboard for monitoring FSx for ONTAP systems. The dashboard offers comprehensive insights into your FSx for ONTAP resources, helping you monitor performance, track metrics, and manage alarms efficiently.
4
+
This sample provides a CloudFormation template to deploy an AWS CloudWatch dashboard for monitoring FSx for ONTAP systems. The dashboard offers comprehensive insights into your FSx for ONTAP resources, helping you monitor performance, track metrics, and manage alarms efficiently.
5
5
The template creates the following resources:
6
6
7
7
1. Dashboard - The Amazon CloudWatch dashboard divided into four main sections:
8
-
a. Overview metrics of all FSx systems in the region
9
-
b. Metrics by individual FSx system
10
-
c. Metrics by volume ID
11
-
d. Alarms
12
-
2. Lambda - The service does the following:
13
-
a. Build custom widgets for the dashboard
14
-
b. Collect metrics directly from ONTAP (like snapmirror unhealthy relations)
15
-
c. Create alarms for all files systems in the region
16
-
3. Schedulers - Two Amazon EventBridge schedulers that triggers the Lambda metrics collection every minute and alarms creating/
17
-
updating/deleting every hour.
18
-
4. Lambda Role - The IAM role that allows the Lambda service to run.
19
-
5. Scheduler Role - The IAM role that allows the scheduler to trigger the Lambda service.
20
-
6. SecretManager endpoint - The Lambda function runs inside a VPC, which by default lacks outgoing internet connectivity. To enable the function to securely access the fsxadmin passwords stored in AWS Secrets Manager, a VPC endpoint for the Secrets Manager service is required. This endpoint allows the Lambda function to retrieve sensitive information from Secrets Manager without needing direct internet access, maintaining security while ensuring the function can access the necessary credentials.
21
-
7. CloudWatch endpoint - The Lambda function runs inside a VPC, which by default lacks outgoing internet connectivity. To enable the function to send logs and metrics to CloudWatch, a VPC endpoint for the CloudWatch service is required.
22
-
This endpoint allows the Lambda function to communicate with CloudWatch without needing direct internet access, maintaining security while ensuring proper monitoring and logging functionality.
23
-
8. FsxService endpoint - The Lambda function runs inside a VPC, which by default lacks outgoing internet connectivity. To enable the
24
-
function to send calls to FsxService to reterive file systems inforamtion.
8
+
a. Overview metrics of all FSx systems in the region.
9
+
b. Metrics by individual FSx system.
10
+
c. Metrics by volume ID.
11
+
d. Alarms.
12
+
2. Lambda function - The service does the following:
13
+
a. Build custom widgets for the dashboard.
14
+
b. Collect metrics directly from ONTAP (like snapmirror health status).
15
+
c. Create CloudWatch alarms for all files systems in the region.
16
+
3. Schedulers - Two Amazon EventBridge schedulers that trigger the Lambda function to:
17
+
a. Collect ONTAP metrics. Scheduled to trigger every minute.
18
+
b. Create, update or delete CloudWatch alarms. Scheduled to trigger once an hour.
19
+
4. Lambda Role - The IAM role that allows the Lambda function to run.
20
+
5. Scheduler Role - The IAM role that allows the scheduler to trigger the Lambda function.
21
+
6. SecretManager endpoint - The Lambda function runs inside a VPC, which by default lacks outgoing internet connectivity. To
22
+
enable the function to securely access the fsxadmin passwords stored in AWS Secrets Manager, a VPC endpoint for the Secrets
23
+
Manager service is required. This endpoint allows the Lambda function to retrieve sensitive information from Secrets Manager
24
+
without needing direct internet access, maintaining security while ensuring the function can access the necessary credentials.
25
+
7. CloudWatch endpoint - The Lambda function runs inside a VPC, which by default lacks outgoing internet connectivity. To enable
26
+
the function to send logs and metrics to CloudWatch, a VPC endpoint for the CloudWatch service is required. This endpoint allows
27
+
the Lambda function to communicate with CloudWatch without needing direct internet access, maintaining security while ensuring
28
+
proper monitoring and logging functionality.
29
+
8. FSxService endpoint - The Lambda function runs inside a VPC, which by default lacks outgoing internet connectivity. To enable the
30
+
function to send calls to FSxService to retrieve file systems information.
25
31
26
32
## Prerequisites
27
33
1. You should have an AWS Account with the following permissions to create and manage resources:
28
-
"cloudformation:DescribeStacks",
29
-
"cloudformation:ListStacks",
30
-
"cloudformation:DescribeStackEvents",
31
-
"cloudformation:ListStackResources",
32
-
"cloudformation:CreateChangeSet",
33
-
"ec2:DescribeSubnets",
34
-
"ec2:DescribeSecurityGroups",
35
-
"ec2:DescribeVpcs",
36
-
"iam:ListRoles",
37
-
"iam:GetRolePolicy",
38
-
"iam:GetRole",
39
-
"iam:DeleteRolePolicy",
40
-
"iam:CreateRole",
41
-
"iam:DetachRolePolicy",
42
-
"iam:PassRole",
43
-
"iam:PutRolePolicy",
44
-
"iam:DeleteRole",
45
-
"iam:AttachRolePolicy",
46
-
"lambda:AddPermission",
47
-
"lambda:RemovePermission",
48
-
"lambda:InvokeFunction",
49
-
"lambda:GetFunction",
50
-
"lambda:CreateFunction",
51
-
"lambda:DeleteFunction",
52
-
"lambda:TagResource",
53
-
"codestar-connections:GetSyncConfiguration",
54
-
"ecr:BatchGetImage",
55
-
"ecr:GetDownloadUrlForLayer",
56
-
"scheduler:GetSchedule",
57
-
"scheduler:CreateSchedule",
58
-
"scheduler:DeleteSchedule",
59
-
"logs:PutRetentionPolicy",
60
-
"secretsmanager:GetSecretValue", (on specific secert)
61
-
34
+
*"cloudformation:DescribeStacks"
35
+
*"cloudformation:ListStacks"
36
+
*"cloudformation:DescribeStackEvents"
37
+
*"cloudformation:ListStackResources"
38
+
*"cloudformation:CreateChangeSet"
39
+
*"ec2:DescribeSubnets"
40
+
*"ec2:DescribeSecurityGroups"
41
+
*"ec2:DescribeVpcs"
42
+
*"iam:ListRoles"
43
+
*"iam:GetRolePolicy"
44
+
*"iam:GetRole"
45
+
*"iam:DeleteRolePolicy"
46
+
*"iam:CreateRole"
47
+
*"iam:DetachRolePolicy"
48
+
*"iam:PassRole"
49
+
*"iam:PutRolePolicy"
50
+
*"iam:DeleteRole"
51
+
*"iam:AttachRolePolicy"
52
+
*"lambda:AddPermission"
53
+
*"lambda:RemovePermission"
54
+
*"lambda:InvokeFunction"
55
+
*"lambda:GetFunction"
56
+
*"lambda:CreateFunction"
57
+
*"lambda:DeleteFunction"
58
+
*"lambda:TagResource"
59
+
*"codestar-connections:GetSyncConfiguration"
60
+
*"ecr:BatchGetImage"
61
+
*"ecr:GetDownloadUrlForLayer"
62
+
*"scheduler:GetSchedule"
63
+
*"scheduler:CreateSchedule"
64
+
*"scheduler:DeleteSchedule"
65
+
*"logs:PutRetentionPolicy"
66
+
*"secretsmanager:GetSecretValue" (on specific secert)
67
+
62
68
2. Optional: create a secret in AWS Secrets Manager with key-value pairs of file system IDs and their corresponding fsxadmin
63
69
passwords. This secret is necessary for making direct ONTAP API calls to monitor resources, such as SnapMirror relations.
64
70
Example secret structure:
65
71
```
66
-
{
67
-
"fs-111222333": "Password1",
68
-
"fs-444555666": "Password2"
69
-
}
72
+
{
73
+
"fs-111222333": "Password1",
74
+
"fs-444555666": "Password2"
75
+
}
70
76
```
71
-
When deploying the CloudFormation template, you will need to provide the ARN of this secret as a parameter. This allows the Lambda to securely access the passwords for monitoring purposes.
77
+
When deploying the CloudFormation template, you will need to provide the ARN of this secret as a parameter. This allows the Lambda function to securely access the passwords for monitoring purposes.
72
78
Note: If you choose not to provide this secret, some monitoring capabilities (such as SnapMirror relations metrics) may be limited.
73
-
74
79
75
80
## Usage
76
81
To use this solution, you will need to run the CloudFormation template in your AWS account.
77
82
The CloudFormation template requires the following parameters:
78
83
79
-
1. Stack name - Identifier for the CloudFormation stack. Must not exceed 25 characters. (Note: While AWS permits stack names up to
80
-
128 characters, limit yours to 25. This name is used in or concatenated with resource names created within the stack, so keeping it short prevents issues with resource naming length limits.)
84
+
1. Stack name - Identifier for the CloudFormation stack. Must not exceed 25 characters. (Note: While AWS allows stack names up to
85
+
128 characters, limit yours to 25. This name is used as base name for other resource names created within the stack, so keeping it short prevents issues with other resource names getting too long.)
81
86
2. VPC ID - The ID of the VPC in which the Lambda function will run. This VPC must have connectivity to all target file systems. It
82
-
can be either the same VPC where the file systems are located, or a different VPC with established connectivity (e.g., VPC peering, Transit Gateway) to the file systems' VPCs.
87
+
can be either the same VPC where the file systems are located, or a different VPC with established connectivity (e.g. VPC peering, Transit Gateway) to the file systems' VPCs.
83
88
3. Subnet IDs - The IDs of the subnets in which the Lambda function will run. These subnets must have connectivity to the file
84
89
systems.
85
90
4. Security Group IDs - The IDs of the Security Groups that will be associated with the Lambda function when it runs. These Security
86
91
Groups must allow connectivity to the file systems.
87
-
5. Create Fsx Service Endpoint - A boolean flag indicating whether you plan to create a FsxService VPC endpoint inside the VPC. Set
92
+
5. Create FSx Service Endpoint - A boolean flag indicating whether you plan to create a FSxService VPC endpoint inside the VPC. Set
88
93
this to true if you want to create the endpoint, or false if you don't. The decision to create this endpoint depends on whether you already have this type of endpoint. If you already have one, set this to false; otherwise, set it to true.
89
94
6. Create Secret Manager Endpoint - A boolean flag indicating whether you plan to create a SecretManager VPC endpoint inside the
90
95
VPC. Set this to true if you want to create the endpoint, or false if you don't. The decision to create this endpoint depends on whether you already have this type of endpoint. If you already have one, set this to false; otherwise, set it to true.
@@ -93,18 +98,18 @@ this to true if you want to create the endpoint, or false if you don't. The deci
93
98
8. Secret Manager FSx Admin Passwords ARN - Optional - The ARN of the AWS Secrets Manager secret containing the fsxadmin passwords.
94
99
This ARN is required for certain functionalities, such as snapmirror metrics collection.
95
100
If not provided, some features may not operate correctly. This secret should contain key-value pairs.
96
-
The key is the File System ID, and the value is the password. For example:
101
+
The key is the File System ID, and the value is the fsxadmin password. For example:
97
102
```
98
-
{
99
-
"fs-111222333":"Password1",
100
-
"fs-444555666":"Password2"
101
-
}
103
+
{
104
+
"fs-111222333":"Password1",
105
+
"fs-444555666":"Password2"
106
+
}
102
107
```
103
108
104
109
## Important Disclaimer: CloudWatch Alarms Deletion
105
110
Please note that when you delete the CloudFormation stack associated with this project, the CloudWatch Alarms created by the stack will not be automatically deleted.
106
111
107
-
CloudFormation does not manage the lifecycle of CloudWatch Alarms created by the Lambda. This means that even after stack deletion, these alarms will persist in your AWS account.
112
+
CloudFormation does not manage the lifecycle of CloudWatch Alarms created by the Lambda function. This means that even after stack deletion, these alarms will persist in your AWS account.
108
113
109
114
To fully clean up resources after using this solution:
110
115
1. Delete the CloudFormation stack as usual.
@@ -124,4 +129,4 @@ You may obtain a copy of the License at apache.org/licenses/LICENSE-2.0.
124
129
125
130
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.
126
131
127
-
See the License for the specific language governing permissions and limitations under the License.
132
+
See the License for the specific language governing permissions and limitations under the License.
0 commit comments