Skip to content

Commit 05717cb

Browse files
committed
beta
1 parent 38dc59a commit 05717cb

File tree

6 files changed

+113
-138
lines changed

6 files changed

+113
-138
lines changed

data-collection/deploy/account-collector.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ Resources:
394394
ROLE_NAME: !Ref ManagementRoleName
395395
MANAGEMENT_ACCOUNT_IDS: !Ref ManagementAccountID
396396
PREFIX: !Ref ResourcePrefix
397-
BUCKET: !Ref DestinationBucket
397+
BUCKET_NAME: !Ref DestinationBucket
398398
PREDEF_ACCOUNT_LIST_KEY: "account-list/account-list"
399399
LINKED_ACCOUNT_LIST_KEY: "linked-account-list.json"
400400
PAYER_ACCOUNT_LIST_KEY: "payer-account-list.json"

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

Lines changed: 29 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Metadata:
4545
- Label:
4646
default: 'EUC Module Settings'
4747
Parameters:
48-
- EUCAccountIDs
48+
- EUCAccountIDs
4949
ParameterLabels:
5050
DestinationBucket:
5151
default: 'Destination S3 bucket prefix'
@@ -128,10 +128,10 @@ Mappings:
128128
us-west-1: {CodeBucket: aws-managed-cost-intelligence-dashboards-us-west-1 }
129129
us-west-2: {CodeBucket: aws-managed-cost-intelligence-dashboards-us-west-2 }
130130
StepFunctionCode:
131-
main-v4-3: {TemplatePath: cfn/data-collection/source/step-functions/main-state-machine-v4-3.json}
132-
crawler-v2: {TemplatePath: cfn/data-collection/source/step-functions/crawler-state-machine-v2.json}
133-
standalone-v2: {TemplatePath: cfn/data-collection/source/step-functions/standalone-state-machine-v2.json}
134-
he-detail-v2: {TemplatePath: cfn/data-collection/source/step-functions/health-detail-state-machine-v2.json}
131+
main-state-machine-v4: {TemplatePath: cfn/data-collection/source/step-functions/main-state-machine-v4.json}
132+
crawler-v2: {TemplatePath: cfn/data-collection/source/step-functions/crawler-state-machine-v2.json}
133+
standalone-v2: {TemplatePath: cfn/data-collection/source/step-functions/standalone-state-machine-v2.json}
134+
health-detail-state-machine-v2-1: {TemplatePath: cfn/data-collection/source/step-functions/health-detail-state-machine-v2-1.json}
135135

136136
Parameters:
137137
DestinationBucket:
@@ -968,7 +968,7 @@ Resources:
968968
Name: dc_execution_log
969969
TableType: EXTERNAL_TABLE
970970
PartitionKeys:
971-
- { Name: datehour, Type: string }
971+
- { Name: logdate, Type: string }
972972
StorageDescriptor:
973973
Columns:
974974
- { Name: timestamp, Type: timestamp }
@@ -998,13 +998,13 @@ Resources:
998998
serialization.format: '1'
999999
Parameters:
10001000
EXTERNAL: 'TRUE'
1001-
projection.datehour.format: yyyy/MM/dd
1002-
projection.datehour.interval: '1'
1003-
projection.datehour.interval.unit: DAYS
1004-
projection.datehour.range: 2025/01/01,NOW
1005-
projection.datehour.type: date
1001+
projection.logdate.format: yyyy/MM/dd
1002+
projection.logdate.interval: '1'
1003+
projection.logdate.interval.unit: DAYS
1004+
projection.logdate.range: 2025/01/01,NOW
1005+
projection.logdate.type: date
10061006
projection.enabled: 'true'
1007-
storage.location.template: !Sub "s3://${DestinationBucket}${AWS::AccountId}/logs/${!datehour}"
1007+
storage.location.template: !Sub "s3://${DestinationBucket}${AWS::AccountId}/logs/modules/${!logdate}"
10081008

10091009
TrustedAdvisorModule:
10101010
Type: AWS::CloudFormation::Stack
@@ -1023,7 +1023,7 @@ Resources:
10231023
LambdaAnalyticsARN: !GetAtt LambdaAnalytics.Arn
10241024
AccountCollectorLambdaARN: !Sub "${AccountCollector.Outputs.LambdaFunctionARN}"
10251025
CodeBucket: !If [ ProdCFNTemplateUsed, !FindInMap [RegionMap, !Ref "AWS::Region", CodeBucket], !Ref CFNSourceBucket ]
1026-
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-v4-3, TemplatePath]
1026+
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-state-machine-v4, TemplatePath]
10271027
StepFunctionExecutionRoleARN: !GetAtt StepFunctionExecutionRole.Arn
10281028
SchedulerExecutionRoleARN: !GetAtt SchedulerExecutionRole.Arn
10291029

@@ -1044,7 +1044,7 @@ Resources:
10441044
LambdaAnalyticsARN: !GetAtt LambdaAnalytics.Arn
10451045
AccountCollectorLambdaARN: !Sub "${AccountCollector.Outputs.LambdaFunctionARN}"
10461046
CodeBucket: !If [ ProdCFNTemplateUsed, !FindInMap [RegionMap, !Ref "AWS::Region", CodeBucket], !Ref CFNSourceBucket ]
1047-
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-v4-3, TemplatePath]
1047+
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-state-machine-v4, TemplatePath]
10481048
StepFunctionExecutionRoleARN: !GetAtt StepFunctionExecutionRole.Arn
10491049
SchedulerExecutionRoleARN: !GetAtt SchedulerExecutionRole.Arn
10501050

@@ -1065,7 +1065,7 @@ Resources:
10651065
LambdaAnalyticsARN: !GetAtt LambdaAnalytics.Arn
10661066
AccountCollectorLambdaARN: !Sub "${AccountCollector.Outputs.LambdaFunctionARN}"
10671067
CodeBucket: !If [ ProdCFNTemplateUsed, !FindInMap [RegionMap, !Ref "AWS::Region", CodeBucket], !Ref CFNSourceBucket ]
1068-
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-v4-3, TemplatePath]
1068+
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-state-machine-v4, TemplatePath]
10691069
StepFunctionExecutionRoleARN: !GetAtt StepFunctionExecutionRole.Arn
10701070
LambdaManageGlueTableARN: !GetAtt LambdaManageGlueTable.Arn
10711071
SchedulerExecutionRoleARN: !GetAtt SchedulerExecutionRole.Arn
@@ -1087,7 +1087,7 @@ Resources:
10871087
LambdaAnalyticsARN: !GetAtt LambdaAnalytics.Arn
10881088
AccountCollectorLambdaARN: !Sub "${AccountCollector.Outputs.LambdaFunctionARN}"
10891089
CodeBucket: !If [ ProdCFNTemplateUsed, !FindInMap [RegionMap, !Ref "AWS::Region", CodeBucket], !Ref CFNSourceBucket ]
1090-
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-v4-3, TemplatePath]
1090+
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-state-machine-v4, TemplatePath]
10911091
StepFunctionExecutionRoleARN: !GetAtt StepFunctionExecutionRole.Arn
10921092
SchedulerExecutionRoleARN: !GetAtt SchedulerExecutionRole.Arn
10931093

@@ -1108,7 +1108,7 @@ Resources:
11081108
LambdaAnalyticsARN: !GetAtt LambdaAnalytics.Arn
11091109
AccountCollectorLambdaARN: !Sub "${AccountCollector.Outputs.LambdaFunctionARN}"
11101110
CodeBucket: !If [ ProdCFNTemplateUsed, !FindInMap [RegionMap, !Ref "AWS::Region", CodeBucket], !Ref CFNSourceBucket ]
1111-
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-v4-3, TemplatePath]
1111+
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-state-machine-v4, TemplatePath]
11121112
StepFunctionExecutionRoleARN: !GetAtt StepFunctionExecutionRole.Arn
11131113
SchedulerExecutionRoleARN: !GetAtt SchedulerExecutionRole.Arn
11141114

@@ -1129,7 +1129,7 @@ Resources:
11291129
LambdaAnalyticsARN: !GetAtt LambdaAnalytics.Arn
11301130
AccountCollectorLambdaARN: !Sub "${AccountCollector.Outputs.LambdaFunctionARN}"
11311131
CodeBucket: !If [ ProdCFNTemplateUsed, !FindInMap [RegionMap, !Ref "AWS::Region", CodeBucket], !Ref CFNSourceBucket ]
1132-
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-v4-3, TemplatePath]
1132+
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-state-machine-v4, TemplatePath]
11331133
StepFunctionExecutionRoleARN: !GetAtt StepFunctionExecutionRole.Arn
11341134
LambdaManageGlueTableARN: !GetAtt LambdaManageGlueTable.Arn
11351135
SchedulerExecutionRoleARN: !GetAtt SchedulerExecutionRole.Arn
@@ -1183,7 +1183,7 @@ Resources:
11831183
LambdaAnalyticsARN: !GetAtt LambdaAnalytics.Arn
11841184
AccountCollectorLambdaARN: !Sub "${AccountCollector.Outputs.LambdaFunctionARN}"
11851185
CodeBucket: !If [ ProdCFNTemplateUsed, !FindInMap [RegionMap, !Ref "AWS::Region", CodeBucket], !Ref CFNSourceBucket ]
1186-
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-v4-3, TemplatePath]
1186+
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-state-machine-v4, TemplatePath]
11871187
StepFunctionExecutionRoleARN: !GetAtt StepFunctionExecutionRole.Arn
11881188
SchedulerExecutionRoleARN: !GetAtt SchedulerExecutionRole.Arn
11891189

@@ -1204,7 +1204,7 @@ Resources:
12041204
LambdaAnalyticsARN: !GetAtt LambdaAnalytics.Arn
12051205
AccountCollectorLambdaARN: !Sub "${AccountCollector.Outputs.LambdaFunctionARN}"
12061206
CodeBucket: !If [ ProdCFNTemplateUsed, !FindInMap [RegionMap, !Ref "AWS::Region", CodeBucket], !Ref CFNSourceBucket ]
1207-
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-v4-3, TemplatePath]
1207+
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-state-machine-v4, TemplatePath]
12081208
StepFunctionExecutionRoleARN: !GetAtt StepFunctionExecutionRole.Arn
12091209
SchedulerExecutionRoleARN: !GetAtt SchedulerExecutionRole.Arn
12101210
RegionsInScope:
@@ -1230,7 +1230,7 @@ Resources:
12301230
LambdaAnalyticsARN: !GetAtt LambdaAnalytics.Arn
12311231
AccountCollectorLambdaARN: !Sub "${AccountCollector.Outputs.LambdaFunctionARN}"
12321232
CodeBucket: !If [ ProdCFNTemplateUsed, !FindInMap [RegionMap, !Ref "AWS::Region", CodeBucket], !Ref CFNSourceBucket ]
1233-
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-v4-3, TemplatePath]
1233+
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-state-machine-v4, TemplatePath]
12341234
StepFunctionExecutionRoleARN: !GetAtt StepFunctionExecutionRole.Arn
12351235
SchedulerExecutionRoleARN: !GetAtt SchedulerExecutionRole.Arn
12361236
RegionsInScope:
@@ -1256,34 +1256,7 @@ Resources:
12561256
LambdaAnalyticsARN: !GetAtt LambdaAnalytics.Arn
12571257
AccountCollectorLambdaARN: !Sub "${AccountCollector.Outputs.LambdaFunctionARN}"
12581258
CodeBucket: !If [ ProdCFNTemplateUsed, !FindInMap [RegionMap, !Ref "AWS::Region", CodeBucket], !Ref CFNSourceBucket ]
1259-
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-v4-3, TemplatePath]
1260-
StepFunctionExecutionRoleARN: !GetAtt StepFunctionExecutionRole.Arn
1261-
SchedulerExecutionRoleARN: !GetAtt SchedulerExecutionRole.Arn
1262-
EUCAccountIDs: !Ref EUCAccountIDs
1263-
RegionsInScope:
1264-
Fn::If:
1265-
- RegionsInScopeIsEmpty
1266-
- !Sub "${AWS::Region}"
1267-
- !Join [ '', !Split [ ' ', !Ref RegionsInScope ] ] # remove spaces
1268-
1269-
EUCUsageModule:
1270-
Type: AWS::CloudFormation::Stack
1271-
Condition: DeployEUCUtilizationModule
1272-
Properties:
1273-
TemplateURL: !Sub "https://${CFNSourceBucket}.s3.${AWS::URLSuffix}/cfn/data-collection/module-workspaces-metrics.yaml"
1274-
Parameters:
1275-
DatabaseName: !Ref DatabaseName
1276-
DataBucketsKmsKeysArns: !Ref DataBucketsKmsKeysArns
1277-
DestinationBucket: !Ref S3Bucket
1278-
DestinationBucketARN: !GetAtt S3Bucket.Arn
1279-
GlueRoleARN: !GetAtt GlueRole.Arn
1280-
MultiAccountRoleName: !Sub "${ResourcePrefix}${MultiAccountRoleName}"
1281-
Schedule: !Ref Schedule
1282-
ResourcePrefix: !Ref ResourcePrefix
1283-
LambdaAnalyticsARN: !GetAtt LambdaAnalytics.Arn
1284-
AccountCollectorLambdaARN: !Sub "${AccountCollector.Outputs.LambdaFunctionARN}"
1285-
CodeBucket: !If [ ProdCFNTemplateUsed, !FindInMap [RegionMap, !Ref "AWS::Region", CodeBucket], !Ref CFNSourceBucket ]
1286-
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-v3, TemplatePath]
1259+
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-state-machine-v4, TemplatePath]
12871260
StepFunctionExecutionRoleARN: !GetAtt StepFunctionExecutionRole.Arn
12881261
SchedulerExecutionRoleARN: !GetAtt SchedulerExecutionRole.Arn
12891262
EUCAccountIDs: !Ref EUCAccountIDs
@@ -1310,7 +1283,7 @@ Resources:
13101283
LambdaAnalyticsARN: !GetAtt LambdaAnalytics.Arn
13111284
AccountCollectorLambdaARN: !Sub "${AccountCollector.Outputs.LambdaFunctionARN}"
13121285
CodeBucket: !If [ ProdCFNTemplateUsed, !FindInMap [RegionMap, !Ref "AWS::Region", CodeBucket], !Ref CFNSourceBucket ]
1313-
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-v4-3, TemplatePath]
1286+
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-state-machine-v4, TemplatePath]
13141287
StepFunctionExecutionRoleARN: !GetAtt StepFunctionExecutionRole.Arn
13151288
SchedulerExecutionRoleARN: !GetAtt SchedulerExecutionRole.Arn
13161289

@@ -1331,7 +1304,7 @@ Resources:
13311304
LambdaAnalyticsARN: !GetAtt LambdaAnalytics.Arn
13321305
AccountCollectorLambdaARN: !Sub "${AccountCollector.Outputs.LambdaFunctionARN}"
13331306
CodeBucket: !If [ ProdCFNTemplateUsed, !FindInMap [RegionMap, !Ref "AWS::Region", CodeBucket], !Ref CFNSourceBucket ]
1334-
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-v4-3, TemplatePath]
1307+
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-state-machine-v4, TemplatePath]
13351308
StepFunctionExecutionRoleARN: !GetAtt StepFunctionExecutionRole.Arn
13361309
SchedulerExecutionRoleARN: !GetAtt SchedulerExecutionRole.Arn
13371310

@@ -1352,7 +1325,7 @@ Resources:
13521325
LambdaAnalyticsARN: !GetAtt LambdaAnalytics.Arn
13531326
AccountCollectorLambdaARN: !Sub "${AccountCollector.Outputs.LambdaFunctionARN}"
13541327
CodeBucket: !If [ ProdCFNTemplateUsed, !FindInMap [RegionMap, !Ref "AWS::Region", CodeBucket], !Ref CFNSourceBucket ]
1355-
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-v4-3, TemplatePath]
1328+
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-state-machine-v4, TemplatePath]
13561329
StepFunctionExecutionRoleARN: !GetAtt StepFunctionExecutionRole.Arn
13571330
SchedulerExecutionRoleARN: !GetAtt SchedulerExecutionRole.Arn
13581331
RegionsInScope:
@@ -1397,10 +1370,10 @@ Resources:
13971370
LambdaAnalyticsARN: !GetAtt LambdaAnalytics.Arn
13981371
AccountCollectorLambdaARN: !Sub "${AccountCollector.Outputs.LambdaFunctionARN}"
13991372
CodeBucket: !If [ ProdCFNTemplateUsed, !FindInMap [RegionMap, !Ref "AWS::Region", CodeBucket], !Ref CFNSourceBucket ]
1400-
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-v4-3, TemplatePath]
1373+
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-state-machine-v4, TemplatePath]
14011374
StepFunctionExecutionRoleARN: !GetAtt StepFunctionExecutionRole.Arn
14021375
SchedulerExecutionRoleARN: !GetAtt SchedulerExecutionRole.Arn
1403-
DetailStepFunctionTemplate: !FindInMap [StepFunctionCode, he-detail-v2, TemplatePath]
1376+
DetailStepFunctionTemplate: !FindInMap [StepFunctionCode, health-detail-state-machine-v2-1, TemplatePath]
14041377

14051378
LicenseManagerModule:
14061379
Type: AWS::CloudFormation::Stack
@@ -1419,7 +1392,7 @@ Resources:
14191392
LambdaAnalyticsARN: !GetAtt LambdaAnalytics.Arn
14201393
AccountCollectorLambdaARN: !Sub "${AccountCollector.Outputs.LambdaFunctionARN}"
14211394
CodeBucket: !If [ ProdCFNTemplateUsed, !FindInMap [RegionMap, !Ref "AWS::Region", CodeBucket], !Ref CFNSourceBucket ]
1422-
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-v4-3, TemplatePath]
1395+
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-state-machine-v4, TemplatePath]
14231396
StepFunctionExecutionRoleARN: !GetAtt StepFunctionExecutionRole.Arn
14241397
SchedulerExecutionRoleARN: !GetAtt SchedulerExecutionRole.Arn
14251398

@@ -1440,7 +1413,7 @@ Resources:
14401413
LambdaAnalyticsARN: !GetAtt LambdaAnalytics.Arn
14411414
AccountCollectorLambdaARN: !Sub "${AccountCollector.Outputs.LambdaFunctionARN}"
14421415
CodeBucket: !If [ ProdCFNTemplateUsed, !FindInMap [RegionMap, !Ref "AWS::Region", CodeBucket], !Ref CFNSourceBucket ]
1443-
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-v4-3, TemplatePath]
1416+
StepFunctionTemplate: !FindInMap [StepFunctionCode, main-state-machine-v4, TemplatePath]
14441417
StepFunctionExecutionRoleARN: !GetAtt StepFunctionExecutionRole.Arn
14451418
SchedulerExecutionRoleARN: !GetAtt SchedulerExecutionRole.Arn
14461419
RegionsInScope:

data-collection/deploy/module-health-events.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ Resources:
409409
boto3.client('s3').upload_file(TMP_FILE, BUCKET, key)
410410
# clear any previous runs for the same day
411411
bucket = boto3.resource('s3').Bucket(BUCKET)
412-
bucket.objects.filter(Prefix=ingestion_time.strftime(f"{MODULE}/{MODULE}-detail-data/payer_id={account_id}/year=%Y/month=%m/day=%d"))
412+
bucket.objects.filter(Prefix=ingestion_time.strftime(f"{MODULE}/{MODULE}-detail-data/payer_id={account_id}/year=%Y/month=%m/day=%d")).delete()
413413
sf = boto3.client('stepfunctions')
414414
sf_input = {
415415
"bucket": BUCKET,

0 commit comments

Comments
 (0)