Skip to content

Commit

Permalink
Bug fixes (#70)
Browse files Browse the repository at this point in the history
* Adding test data

* Refactoring results count, updated examples guide

* merge master

* Added updated s3 ownershipt controls

* capture granularity from query params

* Bug fix: indexer

* Update read me
  • Loading branch information
anuradhawick authored Apr 27, 2023
1 parent ada3e2e commit 10f40b0
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/test-data/GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Now edit the `submission.json` file such that they match the S3 URI of the `vcf.

You can submit the data in two ways.

### Submission as request body
### Option 1: Submission as request body

You can simply copy the edited JSON content in to the API gateway `/submit_dataset` POST endpoint. If you're using a REST client make sure you add authorization headers before you make the request. For example, Postman supports Authorization type AWS Signature and there you can enter AWS Keys.

### Submission as an S3 payload
### Option 2: Submission as an S3 payload

Alternatively, you can upload edited `submission.json` file to an S3 location accessible from deployment. Then you can use the file's S3 URI as follows in the API Gateway or in your REST client.

Expand Down
2 changes: 1 addition & 1 deletion lambda/indexer/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def threaded_request_ontoserver(term, url):
"compose": {
"include": [
{
"system": data["baseUri"],
"system": "http://snomed.info/sct",
"filter": [
{
"property": "concept",
Expand Down
27 changes: 27 additions & 0 deletions s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ resource "aws_s3_bucket" "variants-bucket" {
tags = var.common-tags
}

resource "aws_s3_bucket_ownership_controls" "variants_bucket_ownership_controls" {
bucket = aws_s3_bucket.variants-bucket.id
rule {
object_ownership = "BucketOwnerPreferred"
}
}

resource "aws_s3_bucket_acl" "variants_bucket_acl" {
depends_on = [aws_s3_bucket_ownership_controls.variants_bucket_ownership_controls]

bucket = aws_s3_bucket.variants-bucket.id
acl = "private"
}
Expand Down Expand Up @@ -38,7 +47,16 @@ resource "aws_s3_bucket" "metadata-bucket" {
tags = var.common-tags
}

resource "aws_s3_bucket_ownership_controls" "metadata_bucket_ownership_controls" {
bucket = aws_s3_bucket.metadata-bucket.id
rule {
object_ownership = "BucketOwnerPreferred"
}
}

resource "aws_s3_bucket_acl" "metadata" {
depends_on = [aws_s3_bucket_ownership_controls.metadata_bucket_ownership_controls]

bucket = aws_s3_bucket.metadata-bucket.id
acl = "private"
}
Expand Down Expand Up @@ -82,7 +100,16 @@ resource "aws_s3_bucket" "lambda-layers-bucket" {
tags = var.common-tags
}

resource "aws_s3_bucket_ownership_controls" "lambda_layers_bucket_ownership_controls" {
bucket = aws_s3_bucket.lambda-layers-bucket.id
rule {
object_ownership = "BucketOwnerPreferred"
}
}

resource "aws_s3_bucket_acl" "lambda-layers" {
depends_on = [aws_s3_bucket_ownership_controls.lambda_layers_bucket_ownership_controls]

bucket = aws_s3_bucket.lambda-layers-bucket.id
acl = "private"
}
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ def from_request(self, query_params) -> Self:
self.query.pagination.limit = int(v)
elif k == "includeResultsetResponses":
self.query.include_resultset_responses = IncludeResultsetResponses(v)
elif k == "requestedGranularity":
self.query.requested_granularity = Granularity(v)
else:
req_params_dict[k] = v
if len(req_params_dict):
Expand Down

0 comments on commit 10f40b0

Please sign in to comment.