Skip to content

Commit

Permalink
Merge pull request #351 from umccr/filemanager-eventsource-icav2-pipe…
Browse files Browse the repository at this point in the history
…line-cache-buckets

Added FileManager EventSource with ICAv2 BYOB pipeline cache buckets
  • Loading branch information
victorskl authored Jun 14, 2024
2 parents 56ceae4 + ee21282 commit ce82cb8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ export const oncoanalyserBucket: Record<AppStage, string> = {
[AppStage.PROD]: 'org.umccr.data.oncoanalyser',
};

export const icav2PipelineCacheBucket: Record<AppStage, string> = {
[AppStage.BETA]: 'pipeline-dev-cache-503977275616-ap-southeast-2',
[AppStage.GAMMA]: 'pipeline-stg-cache-503977275616-ap-southeast-2',
[AppStage.PROD]: 'pipeline-prod-cache-503977275616-ap-southeast-2',
};

export const gdsBsRunsUploadLogPath: Record<AppStage, string> = {
[AppStage.BETA]: 'gds://development/primary_data/temp/bs_runs_upload_tes/',
[AppStage.GAMMA]: 'gds://staging/primary_data/temp/bs_runs_upload_tes/',
Expand Down
4 changes: 4 additions & 0 deletions config/stacks/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
dataSchemaRegistryName,
vpcProps,
oncoanalyserBucket,
icav2PipelineCacheBucket,
} from '../constants';
import { Duration, RemovalPolicy } from 'aws-cdk-lib';
import { SchemaRegistryProps } from '../../lib/workload/stateful/stacks/shared/constructs/schema-registry';
Expand Down Expand Up @@ -94,6 +95,9 @@ const getEventSourceConstructProps = (stage: AppStage): EventSourceProps => {
{
bucket: oncoanalyserBucket[stage],
},
{
bucket: icav2PipelineCacheBucket[stage],
},
],
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ export class EventSourceConstruct extends Construct {
},
});

let cnt = 1;
for (const prop of props.rules) {
const rule = new Rule(scope, 'Rule', {
const rule = new Rule(scope, 'Rule' + cnt, {
eventPattern: {
source: ['aws.s3'],
detailType: prop.eventTypes,
Expand All @@ -93,6 +94,7 @@ export class EventSourceConstruct extends Construct {
});

rule.addTarget(new SqsQueue(this.queue));
cnt += 1;
}

this.queue.grantSendMessages(new ServicePrincipal('events.amazonaws.com'));
Expand Down

0 comments on commit ce82cb8

Please sign in to comment.