Skip to content

Commit 539ddb5

Browse files
committed
updated: lambda managed glue table; minor optimizaiton
1 parent 7dea4d9 commit 539ddb5

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

data-collection/deploy/deploy-data-collection.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,7 @@ Resources:
10481048
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-state-machine, TemplatePath]
10491049
StepFunctionExecutionRoleARN: !GetAtt StepFunctionExecutionRole.Arn
10501050
SchedulerExecutionRoleARN: !GetAtt SchedulerExecutionRole.Arn
1051+
LambdaManageGlueTableARN: !GetAtt LambdaManageGlueTable.Arn
10511052

10521053
RightsizeModule:
10531054
Type: AWS::CloudFormation::Stack

data-collection/deploy/module-trusted-advisor.yaml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ Parameters:
5050
SchedulerExecutionRoleARN:
5151
Type: String
5252
Description: Common role for module Scheduler execution
53+
LambdaManageGlueTableARN:
54+
Type: String
55+
Description: ARN of a Lambda for Managing GlueTable
5356

5457
Outputs:
5558
StepFunctionARN:
@@ -244,11 +247,9 @@ Resources:
244247
# Get all checks metadata first for dynamic field mapping
245248
checks_metadata = {}
246249
try:
247-
checks_response = trustedadvisor.get_paginator('list_checks').paginate()
248-
for page in checks_response:
249-
for check in page.get('checkSummaries', []):
250-
# Store metadata dictionary for each check ARN
251-
checks_metadata[check['arn']] = check.get('metadata', {})
250+
for check in trustedadvisor.get_paginator('list_checks').paginate().search('checkSummaries'):
251+
# Store metadata dictionary for each check ARN
252+
checks_metadata[check['arn']] = check.get('metadata', {})
252253
except Exception as e:
253254
print(f"Warning: Could not fetch checks metadata: {str(e)}")
254255
checks_metadata = {}
@@ -367,10 +368,9 @@ Resources:
367368

368369
# Add glue table based on existing TAO columns
369370
TADataTable:
370-
Type: AWS::Glue::Table
371+
Type: Custom::ManageGlueTable
371372
Properties:
372-
DatabaseName: !Ref DatabaseName
373-
CatalogId: !Ref AWS::AccountId
373+
ServiceToken: !Ref LambdaManageGlueTableARN
374374
TableInput:
375375
Name: trusted_advisor_data
376376
TableType: EXTERNAL_TABLE
@@ -895,10 +895,9 @@ Resources:
895895

896896
# Add glue table for trusted advisor priority data
897897
TAPriorityTable:
898-
Type: AWS::Glue::Table
898+
Type: Custom::ManageGlueTable
899899
Properties:
900-
DatabaseName: !Ref DatabaseName
901-
CatalogId: !Ref AWS::AccountId
900+
ServiceToken: !Ref LambdaManageGlueTableARN
902901
TableInput:
903902
Name: trusted_advisor_priority_data
904903
TableType: EXTERNAL_TABLE

0 commit comments

Comments
 (0)