@orcabus/platform-cdk-constructs 0.0.103 → 0.0.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +2 -2
- package/api-gateway/api-gateway.js +1 -1
- package/deployment-stack-pipeline/artifact-bucket.js +1 -1
- package/deployment-stack-pipeline/pipeline.js +1 -1
- package/dynamodb/index.js +2 -2
- package/ecs/index.js +1 -1
- package/eventbridge-rules/sfn-slack-notification.js +1 -1
- package/lambda/index.js +1 -1
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/fastq/workflow_helpers.py +28 -5
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/filemanager/file_helpers.py +21 -5
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/filemanager/models.py +51 -1
- package/monitored-queue/index.js +1 -1
- package/named-lambda-role/index.js +1 -1
- package/package.json +1 -1
- package/provider-function/index.js +1 -1
- package/shared-config/networking.js +2 -2
- package/shared-config/slack.js +1 -1
package/.jsii
CHANGED
|
@@ -7163,6 +7163,6 @@
|
|
|
7163
7163
|
"symbolId": "shared-config/slack:SlackAlerts"
|
|
7164
7164
|
}
|
|
7165
7165
|
},
|
|
7166
|
-
"version": "0.0.
|
|
7167
|
-
"fingerprint": "
|
|
7166
|
+
"version": "0.0.104",
|
|
7167
|
+
"fingerprint": "8AsqEKwEq47IHwU7uXbyWa7zxnJSt8IBwMi+dm3nfvs="
|
|
7168
7168
|
}
|
|
@@ -15,7 +15,7 @@ const aws_lambda_1 = require("aws-cdk-lib/aws-lambda");
|
|
|
15
15
|
const aws_route53_targets_1 = require("aws-cdk-lib/aws-route53-targets");
|
|
16
16
|
const config_1 = require("./config");
|
|
17
17
|
class OrcaBusApiGateway extends constructs_1.Construct {
|
|
18
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.apigateway.OrcaBusApiGateway", version: "0.0.
|
|
18
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.apigateway.OrcaBusApiGateway", version: "0.0.104" };
|
|
19
19
|
/**
|
|
20
20
|
* The AWS region where the API Gateway is deployed.
|
|
21
21
|
*/
|
|
@@ -13,7 +13,7 @@ exports.CROSS_DEPLOYMENT_ARTIFACT_BUCKET_NAME = "orcabus-cross-deployment-codepi
|
|
|
13
13
|
exports.CROSS_DEPLOYMENT_ARTIFACT_KMS_ALIAS = "orcabus-cross-deployment-codepipeline-artifact";
|
|
14
14
|
exports.CROSS_DEPLOYMENT_ARTIFACT_KMS_ARN_SSM_PARAMETER_NAME = "/orcabus/deployment-stack-pipeline/artifact-bucket/kms-key-arn";
|
|
15
15
|
class CrossDeploymentArtifactBucket extends constructs_1.Construct {
|
|
16
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.CrossDeploymentArtifactBucket", version: "0.0.
|
|
16
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.CrossDeploymentArtifactBucket", version: "0.0.104" };
|
|
17
17
|
/**
|
|
18
18
|
* The S3 bucket used to store artifacts for cross-deployment pipelines.
|
|
19
19
|
*/
|
|
@@ -32,7 +32,7 @@ exports.DEFAULT_SYNTH_STEP_PARTIAL_BUILD_SPEC = {
|
|
|
32
32
|
* before using this construct.
|
|
33
33
|
*/
|
|
34
34
|
class DeploymentStackPipeline extends constructs_1.Construct {
|
|
35
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.DeploymentStackPipeline", version: "0.0.
|
|
35
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.DeploymentStackPipeline", version: "0.0.104" };
|
|
36
36
|
/**
|
|
37
37
|
* The code pipeline construct that is created.
|
|
38
38
|
*/
|
package/dynamodb/index.js
CHANGED
|
@@ -40,7 +40,7 @@ const dynamodb = __importStar(require("aws-cdk-lib/aws-dynamodb"));
|
|
|
40
40
|
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
41
41
|
const config_1 = require("./config");
|
|
42
42
|
class DynamoDbPartitionedConstruct extends constructs_1.Construct {
|
|
43
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbPartitionedConstruct", version: "0.0.
|
|
43
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbPartitionedConstruct", version: "0.0.104" };
|
|
44
44
|
table;
|
|
45
45
|
constructor(scope, id, props) {
|
|
46
46
|
super(scope, id);
|
|
@@ -75,7 +75,7 @@ class DynamoDbPartitionedConstruct extends constructs_1.Construct {
|
|
|
75
75
|
}
|
|
76
76
|
exports.DynamoDbPartitionedConstruct = DynamoDbPartitionedConstruct;
|
|
77
77
|
class DynamoDbNonPartitionedConstruct extends constructs_1.Construct {
|
|
78
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbNonPartitionedConstruct", version: "0.0.
|
|
78
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbNonPartitionedConstruct", version: "0.0.104" };
|
|
79
79
|
table;
|
|
80
80
|
constructor(scope, id, props) {
|
|
81
81
|
super(scope, id);
|
package/ecs/index.js
CHANGED
|
@@ -55,7 +55,7 @@ exports.LAMBDA_ARCHITECTURE_MAP = {
|
|
|
55
55
|
['ARM64']: lambda.Architecture.ARM_64
|
|
56
56
|
};
|
|
57
57
|
class EcsFargateTaskConstruct extends constructs_1.Construct {
|
|
58
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.ecs.EcsFargateTaskConstruct", version: "0.0.
|
|
58
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.ecs.EcsFargateTaskConstruct", version: "0.0.104" };
|
|
59
59
|
cluster;
|
|
60
60
|
taskDefinition;
|
|
61
61
|
taskExecutionRole;
|
|
@@ -17,7 +17,7 @@ var SfnEventStatus;
|
|
|
17
17
|
SfnEventStatus["ABORTED"] = "ABORTED";
|
|
18
18
|
})(SfnEventStatus || (exports.SfnEventStatus = SfnEventStatus = {}));
|
|
19
19
|
class SfnSlackNotification extends constructs_1.Construct {
|
|
20
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.eventbridgeRule.SfnSlackNotification", version: "0.0.
|
|
20
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.eventbridgeRule.SfnSlackNotification", version: "0.0.104" };
|
|
21
21
|
rule;
|
|
22
22
|
constructor(scope, id, props) {
|
|
23
23
|
super(scope, id);
|
package/lambda/index.js
CHANGED
|
@@ -57,7 +57,7 @@ function getPythonUvDockerImage() {
|
|
|
57
57
|
return aws_cdk_lib_1.DockerImage.fromBuild(path_1.default.join(__dirname, 'build_python'));
|
|
58
58
|
}
|
|
59
59
|
class PythonUvFunction extends aws_lambda_python_alpha_1.PythonFunction {
|
|
60
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.lambda.PythonUvFunction", version: "0.0.
|
|
60
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.lambda.PythonUvFunction", version: "0.0.104" };
|
|
61
61
|
// Class constructs, to be used for caching the layers
|
|
62
62
|
// This means that if there are multiple lambdas throughout the stack
|
|
63
63
|
// They will all use the same layer
|
|
@@ -7,7 +7,7 @@ Workflow helpers - a collection of helper functions for the workflow
|
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
9
|
# Standard library imports
|
|
10
|
-
from typing import List
|
|
10
|
+
from typing import List, Optional
|
|
11
11
|
|
|
12
12
|
# Local imports
|
|
13
13
|
from . import get_fastq_request
|
|
@@ -15,12 +15,35 @@ from .globals import FASTQ_ENDPOINT, FASTQ_SET_ENDPOINT
|
|
|
15
15
|
from .models import FastqListRowDict
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
def to_fastq_list_row(
|
|
18
|
+
def to_fastq_list_row(
|
|
19
|
+
fastq_id: str,
|
|
20
|
+
bucket: Optional[str] = None,
|
|
21
|
+
key_prefix: Optional[str] = None,
|
|
22
|
+
) -> FastqListRowDict:
|
|
19
23
|
return get_fastq_request(
|
|
20
|
-
f"{FASTQ_ENDPOINT}/{fastq_id}/toFastqListRow"
|
|
24
|
+
f"{FASTQ_ENDPOINT}/{fastq_id}/toFastqListRow",
|
|
25
|
+
params=dict(filter(
|
|
26
|
+
lambda param_iter_: param_iter_[1] is not None,
|
|
27
|
+
{
|
|
28
|
+
"bucket": bucket,
|
|
29
|
+
"keyPrefix": key_prefix,
|
|
30
|
+
}.items()
|
|
31
|
+
))
|
|
21
32
|
)
|
|
22
33
|
|
|
23
|
-
|
|
34
|
+
|
|
35
|
+
def to_fastq_list_rows(
|
|
36
|
+
fastq_set_id: str,
|
|
37
|
+
bucket: Optional[str] = None,
|
|
38
|
+
key_prefix: Optional[str] = None,
|
|
39
|
+
) -> List[FastqListRowDict]:
|
|
24
40
|
return get_fastq_request(
|
|
25
|
-
f"{FASTQ_SET_ENDPOINT}/{fastq_set_id}/toFastqListRows"
|
|
41
|
+
f"{FASTQ_SET_ENDPOINT}/{fastq_set_id}/toFastqListRows",
|
|
42
|
+
params=dict(filter(
|
|
43
|
+
lambda param_iter_: param_iter_[1] is not None,
|
|
44
|
+
{
|
|
45
|
+
"bucket": bucket,
|
|
46
|
+
"keyPrefix": key_prefix,
|
|
47
|
+
}.items()
|
|
48
|
+
))
|
|
26
49
|
)
|
|
@@ -5,7 +5,7 @@ import json
|
|
|
5
5
|
from functools import reduce
|
|
6
6
|
from operator import concat
|
|
7
7
|
from pathlib import Path
|
|
8
|
-
from typing import List, Dict, Union
|
|
8
|
+
from typing import List, Dict, Union, Optional, Unpack
|
|
9
9
|
import typing
|
|
10
10
|
import boto3
|
|
11
11
|
from datetime import datetime, timedelta, timezone
|
|
@@ -14,7 +14,7 @@ from itertools import batched
|
|
|
14
14
|
|
|
15
15
|
# Local imports
|
|
16
16
|
from .errors import S3FileNotFoundError, S3DuplicateFileCopyError
|
|
17
|
-
from .models import FileObject, StorageClassPriority
|
|
17
|
+
from .models import FileObject, StorageClassPriority, FileQueryParameters
|
|
18
18
|
from ..utils.miscell import get_bucket_key_pair_from_uri
|
|
19
19
|
from . import (
|
|
20
20
|
get_file_manager_request_response_results,
|
|
@@ -84,7 +84,10 @@ def get_file_object_from_id(s3_object_id: str) -> FileObject:
|
|
|
84
84
|
return FileObject(**response[0])
|
|
85
85
|
|
|
86
86
|
|
|
87
|
-
def get_file_object_from_ingest_id(
|
|
87
|
+
def get_file_object_from_ingest_id(
|
|
88
|
+
ingest_id: str,
|
|
89
|
+
**kwargs: Unpack[FileQueryParameters]
|
|
90
|
+
) -> FileObject:
|
|
88
91
|
response = get_file_manager_request_response_results(S3_LIST_ENDPOINT, {
|
|
89
92
|
"ingestId": ingest_id,
|
|
90
93
|
**kwargs
|
|
@@ -199,8 +202,21 @@ def get_s3_uri_from_s3_object_id(s3_object_id: str) -> str:
|
|
|
199
202
|
return f"s3://{file_object['bucket']}/{file_object['key']}"
|
|
200
203
|
|
|
201
204
|
|
|
202
|
-
def get_s3_uri_from_ingest_id(
|
|
203
|
-
|
|
205
|
+
def get_s3_uri_from_ingest_id(
|
|
206
|
+
ingest_id: str,
|
|
207
|
+
bucket: Optional[str] = None,
|
|
208
|
+
key_prefix: Optional[str] = None
|
|
209
|
+
) -> str:
|
|
210
|
+
file_object: FileObject = get_file_object_from_ingest_id(
|
|
211
|
+
ingest_id=ingest_id,
|
|
212
|
+
**dict(filter(
|
|
213
|
+
lambda param_iter_: param_iter_[1] is not None,
|
|
214
|
+
{
|
|
215
|
+
"bucket": bucket,
|
|
216
|
+
"key": f"{key_prefix}*" if key_prefix else None
|
|
217
|
+
}.items()
|
|
218
|
+
))
|
|
219
|
+
)
|
|
204
220
|
return f"s3://{file_object['bucket']}/{file_object['key']}"
|
|
205
221
|
|
|
206
222
|
|
|
@@ -2,7 +2,9 @@ from typing import (
|
|
|
2
2
|
Optional,
|
|
3
3
|
TypedDict,
|
|
4
4
|
Dict,
|
|
5
|
-
Literal
|
|
5
|
+
Literal,
|
|
6
|
+
NotRequired,
|
|
7
|
+
Any
|
|
6
8
|
)
|
|
7
9
|
|
|
8
10
|
"""
|
|
@@ -49,6 +51,54 @@ StorageClassPriority: Dict[StorageClassType, int] = {
|
|
|
49
51
|
"DeepArchive": 6,
|
|
50
52
|
}
|
|
51
53
|
|
|
54
|
+
EventType = Literal[
|
|
55
|
+
"Created",
|
|
56
|
+
"Deleted",
|
|
57
|
+
"Other"
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
ReasonType = Literal[
|
|
61
|
+
"CreatedPut",
|
|
62
|
+
"CreatedPost",
|
|
63
|
+
"CreatedCopy",
|
|
64
|
+
"CreatedCompleteMultipartUpload",
|
|
65
|
+
"Deleted",
|
|
66
|
+
"DeletedLifecycle",
|
|
67
|
+
"Restored",
|
|
68
|
+
"RestoreExpired",
|
|
69
|
+
"StorageClassChanged",
|
|
70
|
+
"Crawl",
|
|
71
|
+
"Unknown",
|
|
72
|
+
"CrawlRestored"
|
|
73
|
+
]
|
|
74
|
+
|
|
75
|
+
ArchiveStatusType = Literal[
|
|
76
|
+
"ArchiveAccess",
|
|
77
|
+
"DeepArchiveAccess"
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class FileQueryParameters(TypedDict):
|
|
82
|
+
caseSensitive: NotRequired[bool]
|
|
83
|
+
currentState: NotRequired[bool]
|
|
84
|
+
eventType: NotRequired[EventType]
|
|
85
|
+
bucket: NotRequired[str]
|
|
86
|
+
key: NotRequired[str]
|
|
87
|
+
versionId: NotRequired[str]
|
|
88
|
+
eventTime: NotRequired[str]
|
|
89
|
+
size: NotRequired[int]
|
|
90
|
+
sha256: NotRequired[str]
|
|
91
|
+
lastModifiedDate: NotRequired[str]
|
|
92
|
+
eTag: NotRequired[str]
|
|
93
|
+
storageClass: NotRequired[StorageClassType]
|
|
94
|
+
isDeleteMarker: NotRequired[bool]
|
|
95
|
+
reason: NotRequired[ReasonType]
|
|
96
|
+
archiveStatus: NotRequired[ArchiveStatusType]
|
|
97
|
+
isAccessible: NotRequired[bool]
|
|
98
|
+
ingestId: NotRequired[str]
|
|
99
|
+
attributes: NotRequired[Dict[str, Any]]
|
|
100
|
+
|
|
101
|
+
|
|
52
102
|
class FileObject(TypedDict):
|
|
53
103
|
# Identifier
|
|
54
104
|
s3ObjectId: str
|
package/monitored-queue/index.js
CHANGED
|
@@ -13,7 +13,7 @@ const aws_cloudwatch_actions_1 = require("aws-cdk-lib/aws-cloudwatch-actions");
|
|
|
13
13
|
* SNS topic.
|
|
14
14
|
*/
|
|
15
15
|
class MonitoredQueue extends constructs_1.Construct {
|
|
16
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.monitoredQueue.MonitoredQueue", version: "0.0.
|
|
16
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.monitoredQueue.MonitoredQueue", version: "0.0.104" };
|
|
17
17
|
queue;
|
|
18
18
|
deadLetterQueue;
|
|
19
19
|
alarm;
|
|
@@ -7,7 +7,7 @@ const aws_iam_1 = require("aws-cdk-lib/aws-iam");
|
|
|
7
7
|
* A construct which represents a named role that a Lambda function can assume.
|
|
8
8
|
*/
|
|
9
9
|
class NamedLambdaRole extends aws_iam_1.Role {
|
|
10
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.namedLambdaRole.NamedLambdaRole", version: "0.0.
|
|
10
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.namedLambdaRole.NamedLambdaRole", version: "0.0.104" };
|
|
11
11
|
constructor(scope, id, props) {
|
|
12
12
|
super(scope, id, {
|
|
13
13
|
assumedBy: new aws_iam_1.ServicePrincipal("lambda.amazonaws.com"),
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
|
15
15
|
* to the provider framework.
|
|
16
16
|
*/
|
|
17
17
|
class ProviderFunction extends constructs_1.Construct {
|
|
18
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.provider.ProviderFunction", version: "0.0.
|
|
18
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.provider.ProviderFunction", version: "0.0.104" };
|
|
19
19
|
_function;
|
|
20
20
|
_response;
|
|
21
21
|
constructor(scope, id, props) {
|
|
@@ -23,7 +23,7 @@ exports.VPC_LOOKUP_PROPS = {
|
|
|
23
23
|
* Helper for looking up the shared OrcaBus VPC.
|
|
24
24
|
*/
|
|
25
25
|
class OrcaBusVpc {
|
|
26
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.networking.OrcaBusVpc", version: "0.0.
|
|
26
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.networking.OrcaBusVpc", version: "0.0.104" };
|
|
27
27
|
/**
|
|
28
28
|
* The shared VPC that is used by OrcaBus.
|
|
29
29
|
* @param scope
|
|
@@ -42,7 +42,7 @@ exports.SHARED_SECURITY_GROUP_NAME = "OrcaBusSharedComputeSecurityGroup";
|
|
|
42
42
|
* Helper for looking up the shared compute security group by name.
|
|
43
43
|
*/
|
|
44
44
|
class OrcaBusSharedComputeSecurityGroup {
|
|
45
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.networking.OrcaBusSharedComputeSecurityGroup", version: "0.0.
|
|
45
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.networking.OrcaBusSharedComputeSecurityGroup", version: "0.0.104" };
|
|
46
46
|
/**
|
|
47
47
|
* The shared security group that is used by compute resources to access the database.
|
|
48
48
|
* @param scope
|
package/shared-config/slack.js
CHANGED
|
@@ -11,7 +11,7 @@ exports.SLACK_ALERTS_SNS_TOPIC = "AwsChatBotTopic-alerts";
|
|
|
11
11
|
* A helper class to construct the arn for the slack SNS topic.
|
|
12
12
|
*/
|
|
13
13
|
class SlackAlerts {
|
|
14
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.slack.SlackAlerts", version: "0.0.
|
|
14
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.slack.SlackAlerts", version: "0.0.104" };
|
|
15
15
|
/**
|
|
16
16
|
* Format the ARN for the slack alerts SNS topic for the current stack.
|
|
17
17
|
* @param stack
|