Skip to content

Commit

Permalink
Add analogous prod stacks
Browse files Browse the repository at this point in the history
  • Loading branch information
philerooski committed Aug 30, 2024
1 parent 6ac1233 commit 29e77ac
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
13 changes: 13 additions & 0 deletions config/prod/namespaced/lambda-raw-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
template:
path: lambda-raw-role.yaml
stack_name: "{{ stack_group_config.namespace }}-lambda-raw-role"
dependencies:
- prod/namespaced/sqs-dispatch-to-raw.yaml
- prod/s3-cloudformation-bucket.yaml
- prod/s3-raw-bucket.yaml
parameters:
SQSQueueArn: !stack_output_external "{{ stack_group_config.namespace }}-sqs-dispatch-to-raw::PrimaryQueueArn"
S3SourceBucketName: {{ stack_group_config.input_bucket_name }}
S3TargetBucketName: {{ stack_group_config.raw_bucket_name }}
stack_tags:
{{ stack_group_config.default_stack_tags }}
17 changes: 17 additions & 0 deletions config/prod/namespaced/lambda-raw.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
template:
type: sam
path: src/lambda_function/raw/template.yaml
artifact_bucket_name: {{ stack_group_config.template_bucket_name }}
artifact_prefix: "{{ stack_group_config.namespace }}/src/lambda"
dependencies:
- prod/namespaced/lambda-raw-role.yaml
- prod/namespaced/sqs-dispatch-to-raw.yaml
- prod/s3-cloudformation-bucket.yaml
- prod/s3-raw-bucket.yaml
stack_name: "{{ stack_group_config.namespace }}-lambda-raw"
parameters:
RoleArn: !stack_output_external "{{ stack_group_config.namespace }}-lambda-raw-role::RoleArn"
SQSQueueArn: !stack_output_external "{{ stack_group_config.namespace }}-sqs-dispatch-to-raw::PrimaryQueueArn"
S3RawBucket: {{ stack_group_config.raw_bucket_name }}
S3RawKeyPrefix: "{{ stack_group_config.namespace }}/json/"
stack_tags: {{ stack_group_config.default_stack_tags }}
2 changes: 1 addition & 1 deletion config/prod/namespaced/sqs-dispatch-to-raw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ template:
parameters:
MessageRetentionPeriod: "1209600"
ReceiveMessageWaitTimeSeconds: "20"
VisibilityTimeout: "120"
VisibilityTimeout: "900"
SNSTopicSubscription: !stack_output_external "{{ stack_group_config.namespace }}-sns-dispatch::SnsTopicArn"
dependencies:
- prod/namespaced/sns-dispatch.yaml
Expand Down
4 changes: 3 additions & 1 deletion src/lambda_function/raw/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Raw Lambda

The raw Lambda polls the dispatch-to-raw SQS queue and uploads an object to the raw S3 bucket.
Its purpose is to decompress a single file from an export, recompress that file, and store it to S3.
Its purpose is to compress a single JSON file from an export (zip archive) and store it to S3.
It makes heavy use of Python file objects and multipart uploads and can download/compress/upload
with a relatively low, fixed memory overhead with respect to the size of the uncompressed JSON.

## Development

Expand Down

0 comments on commit 29e77ac

Please sign in to comment.