Skip to content

Commit 857a3e0

Browse files
ranchodeluxeranchodeluxe
andauthored
RDS and S3 Changes (#29)
* .gitignore * rds and s3 changes * changes --------- Co-authored-by: ranchodeluxe <greg.corradini@gmail.com>
1 parent 65469a9 commit 857a3e0

4 files changed

Lines changed: 25 additions & 3 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ data/
1010

1111
.pgdata
1212

13+
terraform/veda-wfs3-shared-mcp

terraform/veda-wfs3/functions/s3_event_bridge_to_sfn_execute/lambda_function.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,25 @@ def lambda_handler(event, context):
2020
s3_filename_no_ext = os.path.splitext(s3_filename_target)[0]
2121
print(f"[ S3 FILENAME NO EXT ]: {s3_filename_no_ext}")
2222

23+
if s3_filename_target.endswith(".gpkg"):
24+
return {
25+
'statusCode': 200,
26+
'body': json.dumps('Hello from Lambda!')
27+
}
28+
29+
if s3_event_key.startswith("EIS/FEDSoutput-v3"):
30+
return {
31+
'statusCode': 200,
32+
'body': json.dumps('Hello from Lambda!')
33+
}
34+
2335
bucket_key_prefix = "EIS/FEDSoutput/Snapshot/"
36+
if s3_event_key.startswith("EIS/FEDSoutput-v3"):
37+
bucket_key_prefix = "EIS/FEDSoutput-v3/Snapshot/"
2438
if s3_filename_no_ext.startswith("lf_"):
2539
bucket_key_prefix = "EIS/FEDSoutput/LFArchive/"
2640

41+
2742
# get web token
2843
mwaa_cli_token = client.create_cli_token(
2944
Name=mwaa_env_name
@@ -54,4 +69,4 @@ def lambda_handler(event, context):
5469
return {
5570
'statusCode': 200,
5671
'body': json.dumps('Hello from Lambda!')
57-
}
72+
}

terraform/veda-wfs3/rds.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ resource "aws_db_instance" "db" {
4545
db_name = "veda"
4646
identifier = "${var.project_name}-${var.env}"
4747
engine = "postgres"
48-
engine_version = "14.7"
48+
engine_version = "14.10"
4949
// https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html
5050
allocated_storage = 100
5151
max_allocated_storage = 500

terraform/veda-wfs3/s3_event_bridge_lambda.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,15 @@ resource "aws_lambda_function" "lambda" {
141141
role = aws_iam_role.lambda_exec_role.arn
142142
handler = "lambda_function.lambda_handler"
143143
source_code_hash = data.archive_file.archive.output_base64sha256
144-
runtime = "python3.7"
144+
runtime = "python3.9"
145145
publish = true
146146
tags = var.tags
147+
148+
environment {
149+
variables = {
150+
LOG_GROUP_NAME = "/aws/lambda/s3-event-bridge-to-sfn-execute-${var.project_name}-${var.env}"
151+
}
152+
}
147153
}
148154

149155
resource "aws_cloudwatch_log_group" "group" {

0 commit comments

Comments
 (0)