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: Monitoring/ingest_nas_audit_logs_into_cloudwatch/README.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,15 +39,18 @@ systems that you want to ingest the audit logs from.
39
39
40
40
**You can either create the following items before running the CloudFormation script, or allow it to create the items for you.**
41
41
42
-
- AWS Endpoints. Since the Lambda function runs within your VPC it will not have access to the Internet, even if you can access the Internet
43
-
from the Subnet it runs from. Although, if you are using an AWS Transit Gateway, you can configure it to allow the Lambda function to access the Internet.
44
-
If you don't have a Transit Gateway then there needs to be an VPC endpoint for all the AWS services that the Lambda function uses.
42
+
- AWS Endpoints. Since the Lambda function runs within your VPC it will have restrictions as to how it can access the Internet.
43
+
It will not be able to access the Internet from a "Public" subnet (i.e. one that has a Internet gateway attached it it.) It will, however,
44
+
be able to access the Internet through a Transit or a NAT gateway. So, if the subnets you plan to run this Lambda function from
45
+
don't have a Transit or NAT gateway then there needs to be an VPC AWS service endpoint for all the AWS services that this Lambda function uses.
45
46
Specifically, the Lambda function needs to be able to access the following AWS services:
46
47
- FSx.
47
48
- Secrets Manager.
48
49
- CloudWatch Logs.
49
50
- S3 - Note that typically there is a Gateway type VPC endpoint for S3, therefore you typically you don't need to create a VPC endpoint for S3.
50
51
52
+
**NOTE**: That if you specify to have the CloudFormation template create an endpoint and one already exist, it will cause the CloudFormation script to fail.
53
+
51
54
- Role for the Lambda function. Create a role with the necessary permissions to allow the Lambda function to do the following:
52
55
53
56
<!--- Using HTML to create a table that has rowspan attributes since the markdown table syntax does not support that. --->
@@ -69,7 +72,9 @@ Where:
69
72
70
73
- <accountID> - is your AWS account ID.
71
74
- <region> - is the region where the FSx for ONTAP file systems are located.
72
-
- <secretName> - is the name of the secret that contains the credentials for the fsxadmin accounts.
75
+
- <secretName> - is the name of the secret that contains the credentials for the fsxadmin accounts. Note that this
76
+
resource string, through wild card characters, must include all the secrets that the Lambda function will access. Or
77
+
must list each secret ARN individually.
73
78
74
79
Notes:
75
80
- Since the Lambda function runs within your VPC it needs to be able to create and delete network interfaces.
@@ -96,6 +101,8 @@ and `DeleteNetworkInterface` actions. The correct resource line is `arn:aws:ec2:
96
101
|s3BucketName|Yes|The name of the S3 bucket where the stats file is stored. This bucket must already exist.|
97
102
|s3BucketRegion|Yes|The region of the S3 bucket resides.|
98
103
|copyToS3|No|If set to `true` it will copy the audit logs to the S3 bucket specified in `s3BucketName`.|
104
+
|createWatchdogAlarm|No|If set to `true` it will create a CloudWatch alarm that will alert you if the Lambda function throws in error.|
105
+
|snsTopicArn|No|The ARN of the SNS topic to send the alarm to. This is required if `createWatchdogAlarm` is set to `true`.|
99
106
|fsxnSecretARNsFile|No|The name of a file within the S3 bucket that contains the Secret ARNs for each for the FSxN file systems. The format of the file should be just `<fsID>=<secretARN>`. For example: `fs-0e8d9172fa5411111=arn:aws:secretsmanager:us-east-1:123456789012:secret:fsxadmin-abc123`|
100
107
|fileSystem1ID|No|The ID of the first FSxN file system to ingest the audit logs from.|
101
108
|fileSystem1SecretARN|No|The ARN of the secret that contains the credentials for the first FSx for Data ONTAP file system.|
@@ -107,8 +114,6 @@ and `DeleteNetworkInterface` actions. The correct resource line is `arn:aws:ec2:
107
114
|fileSystem4SecretARN|No|The ARN of the secret that contains the credentials for the forth FSx for Data ONTAP file system.|
108
115
|fileSystem5ID|No|The ID of the fifth FSx for Data ONTAP file system to ingest the audit logs from.|
109
116
|fileSystem5SecretARN|No|The ARN of the secret that contains the credentials for the fifth FSx for Data ONTAP file system.|
110
-
|createWatchdogAlarm|No|If set to `true` it will create a CloudWatch alarm that will alert you if the Lambda function throws in error.|
111
-
|snsTopicArn|No|The ARN of the SNS topic to send the alarm to. This is required if `createWatchdogAlarm` is set to `true`.|
112
117
|lambdaRoleArn|No|The ARN of the role that the Lambda function will use. If not provided, the CloudFormation script will create a role for you.|
113
118
|schedulerRoleArn|No|The ARN of the role that the EventBridge scheduler will run as. If not provided, the CloudFormation script will create a role for you.|
114
119
|createFsxEndpoint|No|If set to `true` it will create the VPC endpoints for the FSx service|
default: "File with list of FSxN file systems and their secret ARNs"
53
+
ParameterLabels:
54
+
volumeName:
55
+
default: "Volume Name"
56
+
checkInterval:
57
+
default: "Check Interval (minutes)"
58
+
logGroupName:
59
+
default: "CloudWatch Log Group Name"
60
+
subNetIds:
61
+
default: "Subnets for Lambda Function"
62
+
lambdaSecurityGroupIds:
63
+
default: "Security Groups for Lambda Function"
64
+
s3BucketName:
65
+
default: "S3 Bucket Name"
66
+
s3BucketRegion:
67
+
default: "S3 Bucket Region"
68
+
copyToS3:
69
+
default: "Copy to S3"
70
+
createWatchdogAlarm:
71
+
default: "Create Watchdog Alarm"
72
+
snsTopicArn:
73
+
default: "SNS Topic ARN"
74
+
fsxnSecretARNsFile:
75
+
default: "File with the list of FSxN file systems and their secret ARNs"
51
76
fileSystem1ID:
52
77
default: "File System 1 ID"
53
78
fileSystem1SecretARN:
@@ -68,6 +93,24 @@ Metadata:
68
93
default: "File System 5 ID"
69
94
fileSystem5SecretARN:
70
95
default: "File System 5 Secret ARN"
96
+
lambdaRoleArn:
97
+
default: "Lambda Role ARN"
98
+
schedulerRoleArn:
99
+
default: "Scheduler Role ARN"
100
+
createFSxEndpoint:
101
+
default: "Create FSx Endpoint"
102
+
createCloudWatchEndpoint:
103
+
default: "Create CloudWatch Endpoint"
104
+
createSecretManagerEndpoint:
105
+
default: "Create Secrets Manager Endpoint"
106
+
createS3Endpoint:
107
+
default: "Create S3 Endpoint"
108
+
routeTableIds:
109
+
default: "Route Table IDs"
110
+
vpcId:
111
+
default: "VPC ID"
112
+
endpointSecurityGroupIds:
113
+
default: "Security Groups for VPC Endpoints"
71
114
72
115
Parameters:
73
116
volumeName:
@@ -78,35 +121,36 @@ Parameters:
78
121
Description: "The interval, in minutes, to check for new audit logs to process."
79
122
Type: Number
80
123
Default: 5
124
+
MinValue: 1
81
125
82
126
logGroupName:
83
-
Description: "The name of the CloudWatch log group to use to store the audit logs. This Log Group must already exist."
127
+
Description: "The name of the CloudWatch log group to store the audit logs to. This Log Group must already exist. It must be in the same region as this CloudFormation stack."
84
128
Type: String
85
129
86
130
subNetIds:
87
-
Description: "The subnet IDs where you want the Lambda function to run. There must be connectivity to all the FSxN management endpoints from these subnets. If creating VPC endpoints, the endpionts will be created in these subnets."
131
+
Description: "The subnet IDs where you want the Lambda function to run. There must be connectivity to all the FSxN management endpoints from these subnets. If creating VPC endpoints, the endpoints will be created in these subnets."
88
132
Type: List<AWS::EC2::Subnet::Id>
89
133
90
134
lambdaSecurityGroupIds:
91
135
Description: "The security group IDs, comma separated list, to associate with the Lambda function. Must allow traffic outbound from the Lambda function over TCP port 443.to the FSxN management endpoints and AWS endpoints."
92
136
Type: List<AWS::EC2::SecurityGroup::Id>
93
137
94
138
s3BucketName:
95
-
Description: "The name of the s3 bucket to use to store the last message processed stats file."
139
+
Description: "The name of the S3 bucket where the last audit file processed stats file will be stored. Also, where the Lambda layer file should already be stored."
96
140
Type: String
97
141
98
142
s3BucketRegion:
99
-
Description: "The AWS region where the s3 bucket resides."
143
+
Description: "The AWS region where the S3 bucket resides."
100
144
Type: String
101
145
102
146
copyToS3:
103
-
Description: "Set to 'true' if you to copy the audit log files to the S3 bucket as well as sending the individual events to the CloudWatch log stream."
147
+
Description: "Set to 'true' if you want to copy the audit log files to the S3 bucket as well as sending the individual events to the CloudWatch log stream."
104
148
Type: String
105
149
Default: "false"
106
150
AllowedValues: ["true", "false"]
107
151
108
152
fsxnSecretARNsFile:
109
-
Description: "The name of the file that contains the list of FSxN file systems and their secret ARNs. Either provide this file or the individual file system IDs and secret ARNs below."
153
+
Description: "The name of the file that contains the list of FSxN file systems and their secret ARNs. It should already be stored in the S3 bucket. Either provide this file or the individual file system IDs and secret ARNs below."
110
154
Type: String
111
155
Default: ""
112
156
@@ -116,7 +160,7 @@ Parameters:
116
160
Default: ""
117
161
118
162
fileSystem1SecretARN:
119
-
Description: "The ARN of the secret in Secrets Manager that holds the credentials for the FSxN file system."
163
+
Description: "The ARN of the secret in Secrets Manager that holds the credentials for the FSxN file system specified above."
120
164
Type: String
121
165
Default: ""
122
166
@@ -126,7 +170,7 @@ Parameters:
126
170
Default: ""
127
171
128
172
fileSystem2SecretARN:
129
-
Description: "The ARN of the secret in Secrets Manager that holds the credentials for the FSxN file system."
173
+
Description: "The ARN of the secret in Secrets Manager that holds the credentials for the FSxN file system specified above."
130
174
Type: String
131
175
Default: ""
132
176
@@ -136,7 +180,7 @@ Parameters:
136
180
Default: ""
137
181
138
182
fileSystem3SecretARN:
139
-
Description: "The ARN of the secret in Secrets Manager that holds the credentials for the FSxN file system."
183
+
Description: "The ARN of the secret in Secrets Manager that holds the credentials for the FSxN file system specified above."
140
184
Type: String
141
185
Default: ""
142
186
@@ -146,7 +190,7 @@ Parameters:
146
190
Default: ""
147
191
148
192
fileSystem4SecretARN:
149
-
Description: "The ARN of the secret in Secrets Manager that holds the credentials for the FSxN file system."
193
+
Description: "The ARN of the secret in Secrets Manager that holds the credentials for the FSxN file system specified above."
150
194
Type: String
151
195
Default: ""
152
196
@@ -155,14 +199,19 @@ Parameters:
155
199
Type: String
156
200
Default: ""
157
201
202
+
fileSystem5SecretARN:
203
+
Description: "The ARN of the secret in Secrets Manager that holds the credentials for the FSxN file system specified above."
204
+
Type: String
205
+
Default: ""
206
+
158
207
createWatchdogAlarm:
159
-
Description: "Create a CloudWatch alarm to monitor the Lambda function. It will send an alert to the SNS topic set below if the function throws an error."
208
+
Description: "Create a CloudWatch alarm to monitor the Lambda function. It will send an alert to the SNS topic set below if the Lambda function throws an error."
160
209
Type: String
161
-
Default: "false"
210
+
Default: "true"
162
211
AllowedValues: ["true", "false"]
163
212
164
213
snsTopicArn:
165
-
Description: "The ARN of the SNS topic to use to send Watchdog alerts to. Only needed if you are creating a Watchdog alarm."
214
+
Description: "The ARN of the SNS topic where the Watchdog should send alerts to. Only needed if you are creating a Watchdog alarm. The topic must be in the same region as this CloudFormation stack."
0 commit comments