Skip to content

Commit

Permalink
Merge pull request #134 from CDLUC3/dynamo-index
Browse files Browse the repository at this point in the history
Dynamo index
  • Loading branch information
briri authored May 7, 2024
2 parents e68d635 + 01378b1 commit 77b6602
Show file tree
Hide file tree
Showing 33 changed files with 801 additions and 553 deletions.
19 changes: 19 additions & 0 deletions config/dev/regional/dynamo-index-table.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
template:
path: dynamo-index-table.yaml
type: file

parameters:
Env: !stack_attr sceptre_user_data.env

Domain: !stack_attr sceptre_user_data.domain

SsmPath: !stack_attr sceptre_user_data.ssm_path

# Dynamo settings
# See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html
DynamoTableClass: 'STANDARD'
DynamoEnableContributorInsights: 'true'
DynamoEnablePointInTimeRecovery: 'true'
DynamoBillingMode: 'PAY_PER_REQUEST'
DynamoReadCapacityUnits: '8'
DynamoWriteCapacityUnits: '30'
7 changes: 6 additions & 1 deletion config/dev/regional/lambda-iam.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ template:
parameters:
Env: !stack_attr sceptre_user_data.env

OpenSearchDomainArn: !stack_output dev/regional/opensearch.yaml::OpenSearchDomainArn
SsmPath: !stack_attr sceptre_user_data.ssm_path
Domain: !stack_attr sceptre_user_data.domain

# OpenSearchDomainArn: !stack_output dev/regional/opensearch.yaml::OpenSearchDomainArn

EventBusArn: !stack_output dev/regional/eventbridge.yaml::EventBusArn

DmpTableArn: !stack_output dev/regional/dynamo.yaml::DynamoTableArn

IndexTableArn: !stack_output dev/regional/dynamo-index-table.yaml::DynamoIndexTableArn
10 changes: 0 additions & 10 deletions config/dev/regional/lambda-vpc.yaml

This file was deleted.

19 changes: 19 additions & 0 deletions config/prd/regional/dynamo-index-table.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
template:
path: dynamo-index-table.yaml
type: file

parameters:
Env: !stack_attr sceptre_user_data.env

Domain: !stack_attr sceptre_user_data.domain

SsmPath: !stack_attr sceptre_user_data.ssm_path

# Dynamo settings
# See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html
DynamoTableClass: 'STANDARD'
DynamoEnableContributorInsights: 'true'
DynamoEnablePointInTimeRecovery: 'true'
DynamoBillingMode: 'PAY_PER_REQUEST'
DynamoReadCapacityUnits: '8'
DynamoWriteCapacityUnits: '30'
7 changes: 6 additions & 1 deletion config/prd/regional/lambda-iam.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ template:
parameters:
Env: !stack_attr sceptre_user_data.env

OpenSearchDomainArn: !stack_output prd/regional/opensearch.yaml::OpenSearchDomainArn
SsmPath: !stack_attr sceptre_user_data.ssm_path
Domain: !stack_attr sceptre_user_data.domain

# OpenSearchDomainArn: !stack_output prd/regional/opensearch.yaml::OpenSearchDomainArn

EventBusArn: !stack_output prd/regional/eventbridge.yaml::EventBusArn

DmpTableArn: !stack_output prd/regional/dynamo.yaml::DynamoTableArn

IndexTableArn: !stack_output prd/regional/dynamo-index-table.yaml::DynamoIndexTableArn
19 changes: 19 additions & 0 deletions config/stg/regional/dynamo-index-table.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
template:
path: dynamo-index-table.yaml
type: file

parameters:
Env: !stack_attr sceptre_user_data.env

Domain: !stack_attr sceptre_user_data.domain

SsmPath: !stack_attr sceptre_user_data.ssm_path

# Dynamo settings
# See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html
DynamoTableClass: 'STANDARD'
DynamoEnableContributorInsights: 'true'
DynamoEnablePointInTimeRecovery: 'true'
DynamoBillingMode: 'PAY_PER_REQUEST'
DynamoReadCapacityUnits: '8'
DynamoWriteCapacityUnits: '30'
7 changes: 6 additions & 1 deletion config/stg/regional/lambda-iam.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ template:
parameters:
Env: !stack_attr sceptre_user_data.env

OpenSearchDomainArn: !stack_output stg/regional/opensearch.yaml::OpenSearchDomainArn
SsmPath: !stack_attr sceptre_user_data.ssm_path
Domain: !stack_attr sceptre_user_data.domain

# OpenSearchDomainArn: !stack_output stg/regional/opensearch.yaml::OpenSearchDomainArn

EventBusArn: !stack_output stg/regional/eventbridge.yaml::EventBusArn

DmpTableArn: !stack_output stg/regional/dynamo.yaml::DynamoTableArn

IndexTableArn: !stack_output stg/regional/dynamo-index-table.yaml::DynamoIndexTableArn
10 changes: 0 additions & 10 deletions config/stg/regional/lambda-vpc.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion src/lambdas/harvesters/datacite/.aws-sam/build.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is auto generated by SAM CLI build command

[function_build_definitions.66e880ba-8a1c-4a71-9af7-3212a8fef2f9]
[function_build_definitions.d040dc14-b551-4b81-b69b-29ae4079ae63]
codeuri = "/Users/briley/Documents/workspace/dmsp_aws_prototype/src/lambdas/harvesters/datacite"
runtime = "ruby3.2"
architecture = "x86_64"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
# outputs. The env prefix will be appended to each name your provide.
# For example if the name of the parameter is 'DomainName' this script will look for 'dev-DomainName'
@cf_params = %w[HarvesterRoleArn S3PrivateBucketId BaselineLayerId EventBusArn DynamoTableName
SnsTopicEmailArn DeadLetterQueueArn]
DynamoIndexTableName SnsTopicEmailArn DeadLetterQueueArn]

# List the names of all other parameters whose values should be available as SSM parameters. The name must
# match the final part of the SSM key name. This script will append the prefix automatically.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ Parameters:
DynamoTableName:
Type: 'String'

DynamoIndexTableName:
Type: 'String'

EventBusArn:
Type: 'String'

Expand All @@ -46,6 +49,7 @@ Resources:
Handler: 'app.Functions::DataCiteHarvester.process'
Runtime: 'ruby3.2'
Timeout: 600
MemorySize: 256
Architectures:
- 'x86_64'
Layers:
Expand All @@ -56,9 +60,10 @@ Resources:
LAMBDA_ENV: !Ref Env
LOG_LEVEL: !Ref DebugLevel # 'debug'
DYNAMO_TABLE: !Ref DynamoTableName
DYNAMO_INDEX_TABLE: !Ref DynamoIndexTableName
SNS_FATAL_ERROR_TOPIC: !Ref SnsTopicEmailArn
Events:
DataCiteHarvesting:
DataCiteHarvester:
Type: 'EventBridgeRule'
Properties:
DeadLetterConfig:
Expand Down
7 changes: 6 additions & 1 deletion src/lambdas/harvesters/datacite/.aws-sam/build/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Parameters:
Type: String
DynamoTableName:
Type: String
DynamoIndexTableName:
Type: String
EventBusArn:
Type: String
SnsTopicEmailArn:
Expand All @@ -33,6 +35,7 @@ Resources:
Handler: app.Functions::DataCiteHarvester.process
Runtime: ruby3.2
Timeout: 600
MemorySize: 256
Architectures:
- x86_64
Layers:
Expand All @@ -47,10 +50,12 @@ Resources:
Ref: DebugLevel
DYNAMO_TABLE:
Ref: DynamoTableName
DYNAMO_INDEX_TABLE:
Ref: DynamoIndexTableName
SNS_FATAL_ERROR_TOPIC:
Ref: SnsTopicEmailArn
Events:
DataCiteHarvesting:
DataCiteHarvester:
Type: EventBridgeRule
Properties:
DeadLetterConfig:
Expand Down
Loading

0 comments on commit 77b6602

Please sign in to comment.