@orcabus/platform-cdk-constructs 0.0.36 → 0.0.37

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 CHANGED
@@ -6756,6 +6756,6 @@
6756
6756
  "symbolId": "shared-config/slack:SlackAlerts"
6757
6757
  }
6758
6758
  },
6759
- "version": "0.0.36",
6760
- "fingerprint": "AQT2JtcqQttpFxgpSQBleYyVLEKOYHPF4q1ii9wJBZ4="
6759
+ "version": "0.0.37",
6760
+ "fingerprint": "WJnxu31JCGx88czmTm4wEcOiYLDLTbs658r/FyyoErY="
6761
6761
  }
@@ -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.36" };
18
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.apigateway.OrcaBusApiGateway", version: "0.0.37" };
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.36" };
16
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.CrossDeploymentArtifactBucket", version: "0.0.37" };
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.36" };
35
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.DeploymentStackPipeline", version: "0.0.37" };
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.36" };
43
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbPartitionedConstruct", version: "0.0.37" };
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.36" };
78
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbNonPartitionedConstruct", version: "0.0.37" };
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.36" };
58
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.ecs.EcsFargateTaskConstruct", version: "0.0.37" };
59
59
  cluster;
60
60
  taskDefinition;
61
61
  taskExecutionRole;
package/lambda/index.js CHANGED
@@ -56,7 +56,7 @@ function getPythonUvDockerImage() {
56
56
  return aws_cdk_lib_1.DockerImage.fromBuild(path_1.default.join(__dirname, 'build_python'));
57
57
  }
58
58
  class PythonUvFunction extends aws_lambda_python_alpha_1.PythonFunction {
59
- static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.lambda.PythonUvFunction", version: "0.0.36" };
59
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.lambda.PythonUvFunction", version: "0.0.37" };
60
60
  // Class constructs, to be used for caching the layers
61
61
  // This means that if there are multiple lambdas throughout the stack
62
62
  // They will all use the same layer
@@ -6,7 +6,7 @@ from typing import Dict, Optional
6
6
  # Local imports
7
7
  from .globals import FASTQ_DECOMPRESSION_SUBDOMAIN_NAME
8
8
  from ..utils.requests_helpers import (
9
- get_request_response_results, get_url, patch_request, get_request
9
+ get_request_response_results, get_url, patch_request, get_request, post_request
10
10
  )
11
11
 
12
12
 
@@ -46,21 +46,21 @@ def get_fastq_decompression_request_response_results(
46
46
 
47
47
  def fastq_decompression_patch_request(
48
48
  endpoint: str,
49
- params: Optional[Dict] = None,
49
+ json_data: Optional[Dict] = None,
50
50
  ):
51
51
  return patch_request(
52
52
  url=get_fastq_decompression_url(endpoint),
53
- params=params
53
+ json_data=json_data
54
54
  )
55
55
 
56
56
 
57
57
  def fastq_decompression_post_request(
58
58
  endpoint: str,
59
- params: Optional[Dict] = None,
59
+ json_data: Optional[Dict] = None,
60
60
  ):
61
- return patch_request(
61
+ return post_request(
62
62
  url=get_fastq_decompression_url(endpoint),
63
- params=params
63
+ json_data=json_data
64
64
  )
65
65
 
66
66
  # Create imports
@@ -4,11 +4,11 @@
4
4
  Create the job
5
5
  """
6
6
 
7
- from typing import List, Optional, Unpack
7
+ from typing import Unpack
8
8
 
9
9
  from . import fastq_decompression_post_request
10
10
  from .globals import JOB_ENDPOINT
11
- from .models import Job, JobType, JobCreateParameters
11
+ from .models import Job, JobCreateParameters
12
12
 
13
13
 
14
14
  def create_job(
@@ -30,5 +30,5 @@ def create_job(
30
30
 
31
31
  return fastq_decompression_post_request(
32
32
  JOB_ENDPOINT,
33
- params=non_null_kwargs
33
+ json_data=non_null_kwargs
34
34
  )
@@ -16,7 +16,7 @@ from typing import (
16
16
  )
17
17
 
18
18
  JobType = Literal['FASTQ_DECOMPRESSION']
19
- JobStatus = Literal['PENDING', 'RUNNING', 'FAILED', 'ABORTED', 'SUCCEEDED']
19
+ JobStatusType = Literal['PENDING', 'RUNNING', 'FAILED', 'ABORTED', 'SUCCEEDED']
20
20
 
21
21
  # Output jobs
22
22
  class DecompressionJobOutputObjectItem(TypedDict):
@@ -73,7 +73,7 @@ class Job(TypedDict):
73
73
  id: str
74
74
  jobType: JobType
75
75
  stepsExecutionArn: str
76
- status: JobStatus
76
+ status: JobStatusType
77
77
  startTime: str
78
78
  endTime: str
79
79
  errorMessages: NotRequired[str]
@@ -90,10 +90,17 @@ class JobCreateParameters(TypedDict):
90
90
  class JobQueryParameters(TypedDict):
91
91
  fastqId: NotRequired[str]
92
92
  fastqSetId: NotRequired[str]
93
- status: NotRequired[JobStatus]
93
+ status: NotRequired[JobStatusType]
94
94
  createdAfter: NotRequired[str]
95
95
  createdBefore: NotRequired[str]
96
96
  completedAfter: NotRequired[str]
97
97
  completedBefore: NotRequired[str]
98
98
  page: NotRequired[int]
99
99
  rowsPerPage: NotRequired[int]
100
+
101
+
102
+ class JobUpdateParameters(TypedDict):
103
+ status: JobStatusType
104
+ errorMessage: NotRequired[str]
105
+ stepsExecutionArn: NotRequired[str]
106
+ output: NotRequired[JobOutputType]
@@ -10,11 +10,11 @@ get_unarchiving_job_list
10
10
  """
11
11
 
12
12
  # Type hints
13
- from typing import List, Unpack
13
+ from typing import List, Unpack, Optional
14
14
 
15
15
  # Local imports
16
16
  from . import get_fastq_decompression_request_response_results
17
- from .models import Job, JobStatus, JobQueryParameters
17
+ from .models import Job, JobStatusType, JobQueryParameters
18
18
  from .globals import JOB_ENDPOINT
19
19
 
20
20
 
@@ -39,13 +39,16 @@ def get_decompression_job_list(**kwargs: Unpack[JobQueryParameters]) -> List[Job
39
39
 
40
40
  def get_job_list_for_fastq(
41
41
  fastq_id: str,
42
- job_status: JobStatus
42
+ status: Optional[JobStatusType] = None
43
43
  ) -> List[Job]:
44
44
  """
45
45
  Check if fastq in job list
46
46
  :return:
47
47
  """
48
- return get_decompression_job_list(
49
- fastqId=fastq_id,
50
- status=job_status
51
- )
48
+ return get_decompression_job_list(**dict(filter(
49
+ lambda kv_iter_: kv_iter_[1] is not None,
50
+ {
51
+ "fastqId": fastq_id,
52
+ "status": status
53
+ }.items()
54
+ )))
@@ -5,39 +5,33 @@ Update helpers for the update script.
5
5
  """
6
6
 
7
7
  # Standard imports
8
- from typing import Optional, Dict, Any
8
+ from typing import Optional, Dict, Any, Unpack
9
9
 
10
10
  # Local imports
11
11
  from . import fastq_decompression_patch_request
12
12
  from .globals import JOB_ENDPOINT
13
- from .models import Job, JobStatus, JobOutputType
13
+ from .models import Job, JobUpdateParameters
14
14
 
15
15
 
16
16
  def update_status(
17
17
  job_id: str,
18
- job_status: JobStatus,
19
- steps_execution_arn: Optional[str] = None,
20
- error_message: Optional[str] = None,
21
- output: Optional[Dict[str, JobOutputType]] = None
18
+ **kwargs: Unpack[JobUpdateParameters]
22
19
  ) -> Job:
23
20
  """
24
21
  Add QC stats to a fastq_id.
25
22
 
26
- :param job_id: The job id
27
- :param job_status: Dictionary of QC stats
28
- :param steps_execution_arn:
29
- :param output:
30
- :param error_message: Optional error message
23
+ :param job_id:
24
+ :param kwargs: JobUpdateStatusParameters
31
25
  """
26
+ # Raise error if any of the kwargs are not in the JobUpdateParameters
27
+ for key in kwargs.keys():
28
+ if key not in JobUpdateParameters.__annotations__:
29
+ raise ValueError(f"Invalid parameter: {key}")
30
+
32
31
  return fastq_decompression_patch_request(
33
32
  f"{JOB_ENDPOINT}/{job_id}",
34
- params=dict(filter(
35
- lambda x: x[1] is not None,
36
- {
37
- "status": job_status,
38
- "errorMessage": error_message,
39
- "stepsExecutionArn": steps_execution_arn,
40
- "output": output
41
- }.items()
33
+ json_data=dict(filter(
34
+ lambda kv_iter_: kv_iter_[1] is not None,
35
+ kwargs.items()
42
36
  ))
43
37
  )
@@ -9,7 +9,7 @@ from ..utils.requests_helpers import (
9
9
  get_request_response_results,
10
10
  get_url,
11
11
  patch_request,
12
- get_request
12
+ get_request, post_request
13
13
  )
14
14
 
15
15
 
@@ -49,21 +49,21 @@ def get_fastq_unarchiving_request_response_results(
49
49
 
50
50
  def fastq_unarchiving_patch_request(
51
51
  endpoint: str,
52
- params: Optional[Dict] = None,
52
+ json_data: Optional[Dict] = None,
53
53
  ):
54
54
  return patch_request(
55
55
  url=get_fastq_unarchiving_url(endpoint),
56
- params=params
56
+ json_data=json_data
57
57
  )
58
58
 
59
59
 
60
60
  def fastq_unarchiving_post_request(
61
61
  endpoint: str,
62
- params: Optional[Dict] = None,
62
+ json_data: Optional[Dict] = None,
63
63
  ):
64
- return patch_request(
64
+ return post_request(
65
65
  url=get_fastq_unarchiving_url(endpoint),
66
- params=params
66
+ json_data=json_data
67
67
  )
68
68
 
69
69
  # Create imports
@@ -35,7 +35,7 @@ def update_status(
35
35
  """
36
36
  return fastq_unarchiving_patch_request(
37
37
  f"{JOB_ENDPOINT}/{job_id}",
38
- params=dict(filter(
38
+ json_data=dict(filter(
39
39
  lambda x: x[1] is not None,
40
40
  {
41
41
  "status": job_status,
@@ -115,17 +115,16 @@ def patch_request(
115
115
  "Authorization": f"Bearer {get_orcabus_token()}"
116
116
  }
117
117
 
118
- req_params = deepcopy(DEFAULT_REQUEST_PARAMS)
119
-
120
- req_params.update(
121
- params if params is not None else {}
122
- )
118
+ if json_data is not None:
119
+ headers.update({
120
+ "Content-Type": "application/json"
121
+ })
123
122
 
124
123
  # Make the request
125
124
  response = requests.patch(
126
125
  url,
127
126
  headers=headers,
128
- params=req_params,
127
+ params=params,
129
128
  json=json_data
130
129
  )
131
130
 
@@ -137,29 +136,34 @@ def patch_request(
137
136
  return response.json()
138
137
 
139
138
 
140
- def post_request(url: str, params: Optional[Dict] = None) -> Dict:
139
+ def post_request(
140
+ url: str,
141
+ json_data: Optional[Dict] = None,
142
+ params: Optional[Dict] = None
143
+ ) -> Dict:
141
144
  """
142
145
  Run post request against the fastq endpoint
146
+ :param json_data:
143
147
  :param url:
144
148
  :param params:
145
149
  :return:
146
150
  """
147
151
  # Get authorization header
148
152
  headers = {
149
- "Authorization": f"Bearer {get_orcabus_token()}"
153
+ "Authorization": f"Bearer {get_orcabus_token()}",
150
154
  }
151
155
 
152
- req_params = deepcopy(DEFAULT_REQUEST_PARAMS)
153
-
154
- req_params.update(
155
- params if params is not None else {}
156
- )
156
+ if json_data is not None:
157
+ headers.update({
158
+ "Content-Type": "application/json"
159
+ })
157
160
 
158
161
  # Make the request
159
162
  response = requests.post(
160
163
  url,
161
164
  headers=headers,
162
- json=req_params
165
+ json=json_data,
166
+ params=params
163
167
  )
164
168
 
165
169
  try:
@@ -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.36" };
16
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.monitoredQueue.MonitoredQueue", version: "0.0.37" };
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.36" };
10
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.namedLambdaRole.NamedLambdaRole", version: "0.0.37" };
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orcabus/platform-cdk-constructs",
3
- "version": "0.0.36",
3
+ "version": "0.0.37",
4
4
  "description": "CDK Package for OrcaBus infrastructure.",
5
5
  "main": "index.ts",
6
6
  "types": "index.d.ts",
@@ -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.36" };
18
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.provider.ProviderFunction", version: "0.0.37" };
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.36" };
26
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.networking.OrcaBusVpc", version: "0.0.37" };
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.36" };
45
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.networking.OrcaBusSharedComputeSecurityGroup", version: "0.0.37" };
46
46
  /**
47
47
  * The shared security group that is used by compute resources to access the database.
48
48
  * @param scope
@@ -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.36" };
14
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.slack.SlackAlerts", version: "0.0.37" };
15
15
  /**
16
16
  * Format the ARN for the slack alerts SNS topic for the current stack.
17
17
  * @param stack