Skip to content

Commit 7bc65aa

Browse files
authored
Added support for periodic recording
1 parent f984602 commit 7bc65aa

File tree

1 file changed

+16
-22
lines changed

1 file changed

+16
-22
lines changed

template.yaml

+16-22
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ Parameters:
1616

1717
ConfigRecorderDailyResourceTypes:
1818
Description: List of all resource types to be set to a daily cadence
19-
Default: "AWS::HealthLake::FHIRDatastore,AWS::Pinpoint::Segment,AWS::Pinpoint::ApplicationSettings"
19+
Default: "AWS::AutoScaling::AutoScalingGroup,AWS::AutoScaling::LaunchConfiguration"
2020
Type: String
2121

22-
ConfigRecorderRecordingFrequency:
23-
Description: Frequency of recording configuration changes.
22+
ConfigRecorderDefaultRecordingFrequency:
23+
Description: Default Frequency of recording configuration changes.
2424
Default: CONTINUOUS
2525
Type: String
2626
AllowedValues:
@@ -29,7 +29,8 @@ Parameters:
2929

3030
CloudFormationVersion:
3131
Type: String
32-
Default: 2
32+
Default: 1
33+
3334

3435
Resources:
3536
LambdaZipsBucket:
@@ -39,6 +40,7 @@ Resources:
3940
ServerSideEncryptionConfiguration:
4041
- ServerSideEncryptionByDefault:
4142
SSEAlgorithm: AES256
43+
4244
LambdaZipsBucketPolicy:
4345
Type: AWS::S3::BucketPolicy
4446
Properties:
@@ -56,19 +58,17 @@ Resources:
5658
Bool:
5759
aws:SecureTransport: false
5860

59-
6061
ProducerLambda:
6162
Type: AWS::Lambda::Function
6263
DeletionPolicy: Retain
6364
DependsOn: CopyZips
6465
Properties:
65-
#FunctionName: ct_configrecorder_override_producer_cf
6666
Code:
6767
S3Bucket: !Ref LambdaZipsBucket
6868
S3Key: ct-blogs-content/ct_configrecorder_override_producer.zip
6969
Handler: ct_configrecorder_override_producer.lambda_handler
7070
Role: !GetAtt ProducerLambdaExecutionRole.Arn
71-
Runtime: python3.11
71+
Runtime: python3.12
7272
MemorySize: 128
7373
Timeout: 300
7474
Architectures:
@@ -94,13 +94,12 @@ Resources:
9494
DeletionPolicy: Retain
9595
DependsOn: CopyZips
9696
Properties:
97-
#FunctionName: ct_configrecorder_override_consumer_cf
9897
Code:
9998
S3Bucket: !Ref LambdaZipsBucket
100-
S3Key: ct-blogs-content/ct_configrecorder_override_consumer_v2.zip
99+
S3Key: ct-blogs-content/ct_configrecorder_override_consumer.zip
101100
Handler: ct_configrecorder_override_consumer.lambda_handler
102101
Role: !GetAtt ConsumerLambdaExecutionRole.Arn
103-
Runtime: python3.11
102+
Runtime: python3.12
104103
MemorySize: 128
105104
Timeout: 180
106105
Architectures:
@@ -109,9 +108,9 @@ Resources:
109108
Environment:
110109
Variables:
111110
LOG_LEVEL: INFO
112-
CONFIG_RECORDER_DAILY_RESOURCE_LIST: !Ref ConfigRecorderDailyResourceTypes
113-
CONFIG_RECORDER_EXCLUDED_RESOURCE_LIST: !Ref ConfigRecorderExcludedResourceTypes
114-
CONFIG_RECORDER_RECORDING_FREQUENCY: !Ref ConfigRecorderRecordingFrequency
111+
CONFIG_RECORDER_OVERRIDE_DAILY_RESOURCE_LIST: !Ref ConfigRecorderDailyResourceTypes
112+
CONFIG_RECORDER_OVERRIDE_EXCLUDED_RESOURCE_LIST: !Ref ConfigRecorderExcludedResourceTypes
113+
CONFIG_RECORDER_DEFAULT_RECORDING_FREQUENCY: !Ref ConfigRecorderDefaultRecordingFrequency
115114

116115
ConsumerLambdaEventSourceMapping:
117116
Type: AWS::Lambda::EventSourceMapping
@@ -192,7 +191,6 @@ Resources:
192191
Type: AWS::SQS::Queue
193192
DeletionPolicy: Retain
194193
Properties:
195-
#QueueName: ct_configrecorder_override_cf
196194
VisibilityTimeout: 180
197195
DelaySeconds: 5
198196
KmsMasterKeyId: alias/aws/sqs
@@ -209,7 +207,7 @@ Resources:
209207
"eventName": ["UpdateLandingZone", "CreateManagedAccount", "UpdateManagedAccount"]
210208
}
211209
}'
212-
Name: !GetAtt SQSConfigRecorder.QueueName #ct_configrecorder_override_cf
210+
Name: !GetAtt SQSConfigRecorder.QueueName
213211
State: ENABLED
214212
Targets:
215213
-
@@ -231,14 +229,11 @@ Resources:
231229
Properties:
232230
ServiceToken: !GetAtt 'CopyZipsFunction.Arn'
233231
DestBucket: !Ref 'LambdaZipsBucket'
234-
#update this to match AWS public bucket
235-
#s3://marketplace-sa-resources/ct-blogs-content/ct_configrecorder_override_consumer_v2.zip
236-
#s3://marketplace-sa-resources/ct-blogs-content/ct_configrecorder_override_producer.zip
237232
SourceBucket: marketplace-sa-resources
238233
Prefix: ct-blogs-content/
239234
Objects:
240235
- 'ct_configrecorder_override_producer.zip'
241-
- 'ct_configrecorder_override_consumer_v2.zip'
236+
- 'ct_configrecorder_override_consumer.zip'
242237

243238
CopyZipsRole:
244239
Type: AWS::IAM::Role
@@ -262,8 +257,7 @@ Resources:
262257
Action:
263258
- s3:GetObject
264259
- s3:GetObjectTagging
265-
Resource:
266-
- !Sub 'arn:${AWS::Partition}:s3:::marketplace-sa-resources/ct-blogs-content/*'
260+
Resource: !Sub 'arn:${AWS::Partition}:s3:::marketplace-sa-resources/ct-blogs-content/*'
267261
- Effect: Allow
268262
Action:
269263
- s3:PutObject
@@ -277,7 +271,7 @@ Resources:
277271
Properties:
278272
Description: Copies objects from the S3 bucket to a new location.
279273
Handler: index.handler
280-
Runtime: python3.10
274+
Runtime: python3.12
281275
Role: !GetAtt 'CopyZipsRole.Arn'
282276
ReservedConcurrentExecutions: 1
283277
Timeout: 300

0 commit comments

Comments
 (0)