Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added FileManager EventSource with ICAv2 BYOB pipeline cache buckets #351

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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',
};

Comment on lines +55 to +60
Copy link
Member

@mmalenic mmalenic Jun 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So these are all buckets that forward events to the respective accounts which then get ingested by filemanager?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. And, there will be more...

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