-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
670 lines (637 loc) · 20.7 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
import type { GuStack } from '@guardian/cdk/lib/constructs/core';
import { GuStringParameter } from '@guardian/cdk/lib/constructs/core';
import { GuSecurityGroup } from '@guardian/cdk/lib/constructs/ec2';
import { GuS3Bucket } from '@guardian/cdk/lib/constructs/s3';
import { GuardianAwsAccounts } from '@guardian/private-infrastructure-config';
import { Aws, Duration } from 'aws-cdk-lib';
import type { IVpc } from 'aws-cdk-lib/aws-ec2';
import { Secret } from 'aws-cdk-lib/aws-ecs';
import { Schedule } from 'aws-cdk-lib/aws-events';
import type { PolicyStatement } from 'aws-cdk-lib/aws-iam';
import type { DatabaseInstance } from 'aws-cdk-lib/aws-rds';
import { Secret as SecretsManager } from 'aws-cdk-lib/aws-secretsmanager';
import { StringParameter } from 'aws-cdk-lib/aws-ssm';
import type { CloudquerySource } from './cluster';
import { CloudqueryCluster } from './cluster';
import {
amigoBakePackagesConfig,
awsSourceConfigForAccount,
awsSourceConfigForOrganisation,
fastlySourceConfig,
galaxiesSourceConfig,
githubLanguagesConfig,
githubSourceConfig,
ns1SourceConfig,
riffraffSourcesConfig,
serviceCatalogueConfigDirectory,
skipTables,
snykSourceConfig,
} from './config';
import { Images } from './images';
import {
cloudqueryAccess,
listOrgsPolicy,
readBucketPolicy,
readDynamoDbTablePolicy,
} from './policies';
interface CloudqueryEcsClusterProps {
vpc: IVpc;
db: DatabaseInstance;
dbAccess: GuSecurityGroup;
nonProdSchedule?: Schedule;
snykCredentials: SecretsManager;
loggingStreamName: string;
logShippingPolicy: PolicyStatement;
gitHubOrg: string;
}
export function addCloudqueryEcsCluster(
scope: GuStack,
props: CloudqueryEcsClusterProps,
) {
const { stage, stack, app = 'service-catalogue' } = scope;
const {
vpc,
db,
dbAccess,
nonProdSchedule,
loggingStreamName,
logShippingPolicy,
gitHubOrg: gitHubOrgName,
} = props;
const riffRaffDatabaseAccessSecurityGroupParam =
StringParameter.valueForStringParameter(
scope,
`/${stage}/deploy/riff-raff/external-database-access-security-group`,
);
// Provisioned by RiffRaff to specifically allow applications other than RiffRaff to access its DB
// See https://github.com/guardian/deploy-tools-platform/pull/731
const applicationToRiffRaffDatabaseSecurityGroup =
GuSecurityGroup.fromSecurityGroupId(
scope,
'RiffRaffDatabaseAccessSecurityGroup',
riffRaffDatabaseAccessSecurityGroupParam,
);
const individualAwsSources: CloudquerySource[] = [
{
name: 'AwsListOrgs',
description:
'Data about the AWS Organisation, including accounts and OUs. Uses include mapping account IDs to account names.',
schedule: nonProdSchedule ?? Schedule.rate(Duration.days(1)),
config: awsSourceConfigForAccount(GuardianAwsAccounts.DeployTools, {
tables: [
/*
Collect all AWS Organisation tables, including account names, and which OU they belong to.
A wildcard is used, as there are a lot of tables!
See https://www.cloudquery.io/docs/advanced-topics/performance-tuning#use-wildcard-matching
*/
'aws_organization*',
],
}),
policies: [
listOrgsPolicy,
cloudqueryAccess(GuardianAwsAccounts.DeployTools),
],
},
{
name: 'AwsDelegatedToSecurityAccount',
description:
'Organisation wide security data, from access analyzer and security hub. Uses include identifying lambdas using deprecated runtimes.',
schedule: nonProdSchedule ?? Schedule.cron({ minute: '0', hour: '22' }),
config: awsSourceConfigForAccount(
GuardianAwsAccounts.Security,
{
tables: ['aws_accessanalyzer_*', 'aws_securityhub_*'],
concurrency: 2000,
},
{
table_options: {
// For more information on how security hub filtering works, see the following links:
// # https://docs.aws.amazon.com/securityhub/1.0/APIReference/API_AwsSecurityFindingFilters.html
// # https://docs.aws.amazon.com/securityhub/1.0/APIReference/API_StringFilter.html
//https://docs.aws.amazon.com/securityhub/1.0/APIReference/API_NumberFilter.html
aws_securityhub_findings: {
get_findings: [
{
filters: {
record_state: [
{
comparison: 'EQUALS',
value: 'ACTIVE',
},
],
compliance_status: [
{
comparison: 'NOT_EQUALS',
value: 'PASSED',
},
],
workflow_status: [
{
comparison: 'NOT_EQUALS',
value: 'RESOLVED',
},
],
},
},
],
},
},
},
),
policies: [cloudqueryAccess(GuardianAwsAccounts.Security)],
memoryLimitMiB: 2048,
cpu: 1024,
},
{
name: 'AwsOrgWideCloudFormation',
description:
'Collecting CloudFormation data across the organisation. We use CloudFormation stacks as a proxy for a service, so collect the data multiple times a day',
schedule: nonProdSchedule ?? Schedule.rate(Duration.hours(3)),
config: awsSourceConfigForOrganisation({
tables: ['aws_cloudformation_*'],
}),
policies: [listOrgsPolicy, cloudqueryAccess('*')],
memoryLimitMiB: 1024,
},
{
name: 'AwsCostExplorer',
description:
'Collecting Aws Cost Explorer Information. This is usefull for reservations',
schedule: nonProdSchedule ?? Schedule.rate(Duration.days(7)),
config: awsSourceConfigForOrganisation({
tables: ['aws_costexplorer_*'],
}),
policies: [listOrgsPolicy, cloudqueryAccess('*')],
},
{
name: 'AwsOrgWideLoadBalancers',
description:
'Collecting load balancer data across the organisation. Uses include building SLO dashboards.',
schedule: nonProdSchedule ?? Schedule.rate(Duration.minutes(30)),
config: awsSourceConfigForOrganisation({
tables: ['aws_elbv1_*', 'aws_elbv2_*'],
}),
policies: [listOrgsPolicy, cloudqueryAccess('*')],
},
{
name: 'AwsOrgWideAutoScalingGroups',
description:
'Collecting ASG data across the organisation. Uses include building SLO dashboards.',
schedule: nonProdSchedule ?? Schedule.cron({ minute: '0', hour: '0' }),
config: awsSourceConfigForOrganisation({
tables: ['aws_autoscaling_groups'],
}),
policies: [listOrgsPolicy, cloudqueryAccess('*')],
},
{
name: 'AwsOrgWideCertificates',
description:
'Collecting certificate data across the organisation. Uses include building SLO dashboards.',
schedule: nonProdSchedule ?? Schedule.cron({ minute: '0', hour: '1' }),
config: awsSourceConfigForOrganisation({
tables: ['aws_acm*'],
}),
policies: [listOrgsPolicy, cloudqueryAccess('*')],
},
{
name: 'AwsLambda',
description: 'Collecting lambda data across the organisation.',
schedule: nonProdSchedule ?? Schedule.cron({ minute: '10', hour: '1' }),
config: awsSourceConfigForOrganisation({
tables: ['aws_lambda_*'],
}),
policies: [listOrgsPolicy, cloudqueryAccess('*')],
},
{
name: 'AwsSSMParameters',
description: 'Collecting ssm parameters across the organisation.',
schedule: nonProdSchedule ?? Schedule.cron({ minute: '20', hour: '1' }),
config: awsSourceConfigForOrganisation({
tables: ['aws_ssm_parameters'],
}),
policies: [listOrgsPolicy, cloudqueryAccess('*')],
},
{
name: 'AwsOrgWideCloudwatchAlarms',
description:
'Collecting CloudWatch Alarm data across the organisation. Uses include building SLO dashboards.',
schedule: nonProdSchedule ?? Schedule.cron({ minute: '0', hour: '2' }),
config: awsSourceConfigForOrganisation({
tables: ['aws_cloudwatch_alarms'],
}),
policies: [listOrgsPolicy, cloudqueryAccess('*')],
},
{
name: 'AwsOrgWideInspector',
description: 'Collecting Inspector data across the organisation.',
schedule: nonProdSchedule ?? Schedule.cron({ minute: '0', hour: '3' }),
config: awsSourceConfigForOrganisation({
tables: ['aws_inspector_findings', 'aws_inspector2_findings'],
}),
policies: [listOrgsPolicy, cloudqueryAccess('*')],
memoryLimitMiB: 1024,
},
{
name: 'AwsOrgWideS3',
description:
'Collecting S3 data across the organisation. Uses include identifying which account a bucket resides.',
schedule: nonProdSchedule ?? Schedule.cron({ minute: '0', hour: '4' }),
config: awsSourceConfigForOrganisation({
tables: ['aws_s3*'],
}),
policies: [listOrgsPolicy, cloudqueryAccess('*')],
},
{
name: 'AwsOrgWideDynamoDB',
description:
'Collecting DynamoDB data across the organisation. Uses include auditing backup configuration.',
schedule: nonProdSchedule ?? Schedule.cron({ minute: '0', hour: '5' }),
config: awsSourceConfigForOrganisation({
tables: ['aws_dynamodb*'],
}),
policies: [listOrgsPolicy, cloudqueryAccess('*')],
},
{
name: 'AwsOrgWideRDS',
description:
'Collecting RDS data across the organisation. Uses include auditing backup configuration.',
schedule: nonProdSchedule ?? Schedule.cron({ minute: '0', hour: '6' }),
config: awsSourceConfigForOrganisation({
tables: [
'aws_rds_instances',
'aws_rds_clusters',
'aws_rds_db_snapshots',
'aws_rds_cluster_snapshots',
],
}),
policies: [listOrgsPolicy, cloudqueryAccess('*')],
},
{
name: 'AwsOrgWideBackup',
description:
'Collecting Backup data across the organisation. Uses include auditing backup configuration.',
schedule: nonProdSchedule ?? Schedule.cron({ minute: '0', hour: '7' }),
config: awsSourceConfigForOrganisation({
tables: [
'aws_backup_protected_resources',
'aws_backup_vaults',
'aws_backup_vault_recovery_points',
],
}),
policies: [listOrgsPolicy, cloudqueryAccess('*')],
memoryLimitMiB: 1024,
},
{
name: 'AwsOrgWideEc2',
description:
'Collecting EC2 instance information, and their security groups. Uses include identifying instances failing the "30 day old" SLO, and (eventually) replacing Prism.',
schedule: nonProdSchedule ?? Schedule.rate(Duration.minutes(30)),
config: awsSourceConfigForOrganisation({
tables: [
'aws_ec2_instances',
'aws_ec2_security_groups',
'aws_ec2_images',
],
}),
policies: [listOrgsPolicy, cloudqueryAccess('*')],
runAsSingleton: true,
memoryLimitMiB: 1024,
},
{
name: 'AwsOrgWideIamCredentialReports',
description:
'Collecting IAM credential reports to surface information about outdated or inactive users and access keys',
schedule: nonProdSchedule ?? Schedule.rate(Duration.hours(4)),
config: awsSourceConfigForOrganisation({
tables: ['aws_iam_credential_reports'],
}),
policies: [listOrgsPolicy, cloudqueryAccess('*')],
memoryLimitMiB: 1024,
},
];
/*
This is a catch-all task, collecting all other AWS data.
Although we're not using the data for any particular reason, it is still useful to have.
It runs once a week because there is a lot of data, and we need to avoid overlapping invocations.
If we identify a table that needs to be updated more often, we should create a dedicated task for it.
*/
const remainingAwsSources: CloudquerySource = {
name: 'AwsRemainingData',
description: 'Data fetched across all accounts in the organisation.',
schedule:
nonProdSchedule ??
Schedule.cron({ minute: '0', hour: '16', weekDay: 'SAT' }), // Every Saturday, at 4PM UTC
config: awsSourceConfigForOrganisation({
tables: ['aws_*'],
skipTables: [
...skipTables,
// casting because `config.spec.tables` could be empty, though in reality it never is
...(individualAwsSources.flatMap(
(_) => _.config.spec.tables,
) as string[]),
],
// Defaulted to 500000 by ServiceCatalogue, concurrency controls the maximum number of Go routines to use.
// The amount of memory used is a function of this value.
// See https://www.cloudquery.io/docs/reference/source-spec#concurrency.
concurrency: 2000,
}),
policies: [listOrgsPolicy, cloudqueryAccess('*')],
// This task is quite expensive, and requires more power than the default (500MB memory, 0.25 vCPU).
memoryLimitMiB: 3072,
cpu: 1024,
};
const cloudqueryGithubCredentials = new SecretsManager(
scope,
'github-credentials',
{
secretName: `/${stage}/${stack}/${app}/github-credentials`,
},
);
const githubSecrets: Record<string, Secret> = {
GITHUB_PRIVATE_KEY: Secret.fromSecretsManager(
cloudqueryGithubCredentials,
'private-key',
),
GITHUB_APP_ID: Secret.fromSecretsManager(
cloudqueryGithubCredentials,
'app-id',
),
GITHUB_INSTALLATION_ID: Secret.fromSecretsManager(
cloudqueryGithubCredentials,
'installation-id',
),
};
const additionalGithubCommands = [
`echo -n $GITHUB_PRIVATE_KEY | base64 -d > ${serviceCatalogueConfigDirectory}/github-private-key`,
`echo -n $GITHUB_APP_ID > ${serviceCatalogueConfigDirectory}/github-app-id`,
`echo -n $GITHUB_INSTALLATION_ID > ${serviceCatalogueConfigDirectory}/github-installation-id`,
];
const githubSources: CloudquerySource[] = [
{
name: 'GitHubRepositories',
description:
'Collect GitHub repository data. Uses include RepoCop, which flags repositories that do not meet certain obligations.',
schedule: nonProdSchedule ?? Schedule.cron({ minute: '0', hour: '0' }),
config: githubSourceConfig({
org: gitHubOrgName,
tables: [
'github_repositories',
'github_repository_branches',
'github_repository_collaborators',
'github_repository_custom_properties',
'github_workflows',
],
// We're not (yet) interested in the following tables, so do not collect them to reduce API quota usage.
// See https://www.cloudquery.io/docs/advanced-topics/performance-tuning#improve-performance-by-skipping-relations
skipTables: [
'github_releases',
'github_release_assets',
'github_repository_dependabot_alerts',
'github_repository_dependabot_secrets',
],
}),
secrets: githubSecrets,
additionalCommands: additionalGithubCommands,
memoryLimitMiB: 2048,
},
{
name: 'GitHubTeams',
description:
'Collect GitHub team data. Uses include identifying which repositories a team owns.',
schedule:
nonProdSchedule ??
Schedule.cron({ weekDay: '1', hour: '10', minute: '0' }),
config: githubSourceConfig({
org: gitHubOrgName,
tables: [
'github_organizations',
'github_organization_members',
'github_teams',
'github_team_members',
'github_team_repositories',
],
skipTables: [
/*
These tables are children of github_organizations.
ServiceCatalogue collects child tables automatically.
We don't use them as they take a long time to collect, so skip them.
See https://www.cloudquery.io/docs/advanced-topics/performance-tuning#improve-performance-by-skipping-relations
*/
'github_organization_dependabot_alerts',
'github_organization_dependabot_secrets',
],
}),
secrets: githubSecrets,
additionalCommands: additionalGithubCommands,
memoryLimitMiB: 4096,
cpu: 2048,
},
{
name: 'GitHubIssues',
description: 'Collect GitHub issue data (PRs and Issues)',
schedule: nonProdSchedule ?? Schedule.cron({ minute: '0', hour: '2' }),
config: githubSourceConfig({
org: gitHubOrgName,
tables: ['github_issues'],
skipTables: [
/*
These tables are children of github_issues.
ServiceCatalogue collects child tables automatically.
We don't use them as they take a long time to collect, so skip them.
See https://www.cloudquery.io/docs/advanced-topics/performance-tuning#improve-performance-by-skipping-relations
*/
'github_issue_timeline_events',
'github_issue_pullrequest_reviews',
],
}),
secrets: githubSecrets,
additionalCommands: additionalGithubCommands,
memoryLimitMiB: 2048,
},
];
const fastlyCredentials = new SecretsManager(scope, 'fastly-credentials', {
secretName: `/${stage}/${stack}/${app}/fastly-credentials`,
});
const fastlySources: CloudquerySource[] = [
{
name: 'FastlyServices',
description: 'Fastly services data',
schedule: nonProdSchedule ?? Schedule.rate(Duration.days(1)),
config: fastlySourceConfig({
tables: [
'fastly_services',
'fastly_service_versions',
'fastly_service_backends',
'fastly_service_domains',
'fastly_service_health_checks',
'fastly_account_users',
],
}),
secrets: {
FASTLY_API_KEY: Secret.fromSecretsManager(fastlyCredentials, 'api-key'),
},
},
];
// The bucket in which the Galaxies data lives.
const actionsStaticSiteBucketArn = new GuStringParameter(
scope,
'ActionsStaticSiteBucketArnParam',
{
fromSSM: true,
default: '/INFRA/deploy/cloudquery/actions-static-site-bucket-arn',
},
).valueAsString;
const actionsStaticSiteBucket = GuS3Bucket.fromBucketArn(
scope,
'ActionsStaticSiteBucket',
actionsStaticSiteBucketArn,
);
const galaxiesSources: CloudquerySource[] = [
{
name: 'Galaxies',
description: 'Galaxies data',
schedule: nonProdSchedule ?? Schedule.rate(Duration.days(1)),
policies: [
readBucketPolicy(
`${actionsStaticSiteBucket.bucketArn}/galaxies.gutools.co.uk/data/*`,
),
],
config: galaxiesSourceConfig(actionsStaticSiteBucket.bucketName),
},
];
const snykSources: CloudquerySource[] = [
{
name: 'SnykAll',
description: 'Collecting all Snyk data, except for projects',
schedule: nonProdSchedule ?? Schedule.cron({ minute: '0', hour: '6' }),
config: snykSourceConfig({
tables: [
'snyk_issues',
'snyk_organizations',
'snyk_projects',
'snyk_sbom',
],
skipTables: [],
}),
secrets: {
SNYK_API_KEY: Secret.fromSecretsManager(
props.snykCredentials,
'api-key',
),
},
memoryLimitMiB: 1024,
},
];
const cloudqueryRiffRaffDatabaseCredentials = new SecretsManager(
scope,
'RiffRaffDatabaseCredentials',
{
secretName: `/${stage}/${stack}/${app}/riffraff-database-credentials`,
},
);
const riffRaffSources: CloudquerySource = {
name: 'RiffRaffData',
description: "Source deployment data directly from riff-raff's database",
schedule: nonProdSchedule ?? Schedule.cron({ minute: '0', hour: '0' }),
config: riffraffSourcesConfig(),
additionalSecurityGroups: [applicationToRiffRaffDatabaseSecurityGroup],
secrets: {
RIFFRAFF_DB_USERNAME: Secret.fromSecretsManager(
cloudqueryRiffRaffDatabaseCredentials,
'username',
),
RIFFRAFF_DB_PASSWORD: Secret.fromSecretsManager(
cloudqueryRiffRaffDatabaseCredentials,
'password',
),
RIFFRAFF_DB_HOST: Secret.fromSecretsManager(
cloudqueryRiffRaffDatabaseCredentials,
'host',
),
},
};
const githubLanguagesSecret = new SecretsManager(scope, 'github-languages', {
secretName: `/${stage}/${stack}/${app}/github-languages`,
});
const githubLanguagesSource: CloudquerySource = {
name: 'GitHubLanguages',
description: 'Collect GitHub languages data',
schedule: nonProdSchedule ?? Schedule.rate(Duration.days(7)),
config: githubLanguagesConfig(),
secrets: {
GITHUB_ACCESS_TOKEN: Secret.fromSecretsManager(githubLanguagesSecret),
},
// additionalCommands: additionalGithubCommands,
};
const ns1ApiKey = new SecretsManager(scope, 'ns1-credentials', {
secretName: `/${stage}/${stack}/${app}/ns1-credentials`,
});
const ns1Source: CloudquerySource = {
name: 'NS1',
description: 'DNS records from NS1',
schedule: nonProdSchedule ?? Schedule.cron({ minute: '0', hour: '0' }),
dockerDistributedPluginImage: Images.ns1Source,
secrets: {
NS1_API_KEY: Secret.fromSecretsManager(ns1ApiKey, 'api-key'),
},
config: ns1SourceConfig(),
};
const packagesBucketName = new GuStringParameter(
scope,
'packagesBucketNameParam',
{
fromSSM: true,
default: `/${stage}/deploy/amigo/amigo.data.bucket`,
},
).valueAsString;
const packagesBucket = GuS3Bucket.fromBucketName(
scope,
'packagesBucket',
packagesBucketName,
);
const baseImagesTableName = `amigo-${stage}-base-images`;
const recipesTableName = `amigo-${stage}-recipes`;
const bakesTableName = `amigo-${stage}-bakes`;
const amigoBakePackagesSource: CloudquerySource = {
name: 'AmigoBakePackages',
description: 'Packages installed in Amigo bakes.',
schedule: nonProdSchedule ?? Schedule.cron({ minute: '0', hour: '3' }),
config: amigoBakePackagesConfig(
baseImagesTableName,
recipesTableName,
bakesTableName,
packagesBucket.bucketName,
),
memoryLimitMiB: 1024,
policies: [
readDynamoDbTablePolicy(
GuardianAwsAccounts.DeployTools,
Aws.REGION,
baseImagesTableName,
recipesTableName,
bakesTableName,
),
readBucketPolicy(`${packagesBucket.bucketArn}/packagelists/*`),
],
};
return new CloudqueryCluster(scope, `${app}Cluster`, {
app,
vpc,
db,
dbAccess,
loggingStreamName,
logShippingPolicy,
sources: [
...individualAwsSources,
remainingAwsSources,
...githubSources,
...fastlySources,
...galaxiesSources,
...snykSources,
riffRaffSources,
githubLanguagesSource,
ns1Source,
amigoBakePackagesSource,
],
});
}