Skip to content

Commit

Permalink
Merge pull request #31 from awslabs/release/1.1.3
Browse files Browse the repository at this point in the history
fix: Remove dependency for us-east-1, add environment variable for de…
  • Loading branch information
ruiscosta committed Dec 19, 2023
2 parents 3752a76 + 6e7a1c3 commit f598ef3
Show file tree
Hide file tree
Showing 21 changed files with 178 additions and 126 deletions.
4 changes: 3 additions & 1 deletion api/archive/archive/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import datetime
import uuid

REGION = os.getenv("REGION")

# region Logging

LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO")
Expand All @@ -35,7 +37,7 @@

# endregion

dynamodb = boto3.resource('dynamodb', region_name='us-east-1')
dynamodb = boto3.resource('dynamodb', region_name=REGION)
ssm = boto3.client('ssm')


Expand Down
4 changes: 3 additions & 1 deletion api/archive/expiration/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import traceback
from datetime import datetime

REGION = os.getenv("REGION")

# region Logging

LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO")
Expand Down Expand Up @@ -69,7 +71,7 @@ def build_response(http_code, body):
def lambda_handler(event, context):
logger.info(mask_sensitive_data(event))

dynamodb = boto3.resource('dynamodb', region_name='us-east-1')
dynamodb = boto3.resource('dynamodb', region_name=REGION)

body = json.loads(
event["body"]) if "body" in event else json.loads(event)
Expand Down
4 changes: 3 additions & 1 deletion api/archive/legal/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
import os
import traceback

REGION = os.getenv("REGION")

s3 = boto3.resource('s3')
s3_client = boto3.client('s3')
dynamodb = boto3.resource('dynamodb', region_name='us-east-1')
dynamodb = boto3.resource('dynamodb', region_name=REGION)
ssm = boto3.client('ssm')

# region Logging
Expand Down
4 changes: 3 additions & 1 deletion api/archive/validate/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import datetime
import uuid

REGION = os.getenv("REGION")

# region Logging

LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO")
Expand Down Expand Up @@ -64,7 +66,7 @@ def build_response(http_code, body):

def lambda_handler(event, context):
logger.info(mask_sensitive_data(event))
dynamodb = boto3.resource('dynamodb', region_name='us-east-1')
dynamodb = boto3.resource('dynamodb', region_name=REGION)
ssm = boto3.client('ssm')

try:
Expand Down
3 changes: 2 additions & 1 deletion api/archives/list/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

from decimal import Decimal

REGION = os.getenv("REGION")

class DecimalEncoder(json.JSONEncoder):
def default(self, obj):
Expand All @@ -42,7 +43,7 @@ def default(self, obj):
# endregion

ssm = boto3.client('ssm')
dynamodb = boto3.resource('dynamodb', region_name="us-east-1")
dynamodb = boto3.resource('dynamodb', region_name=REGION)

def mask_sensitive_data(event):
# remove sensitive data from request object before logging
Expand Down
4 changes: 3 additions & 1 deletion api/job/run/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import traceback
import uuid

REGION = os.getenv("REGION")

# region Logging

LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO")
Expand All @@ -36,7 +38,7 @@

ssm = boto3.client('ssm')
client = boto3.client('stepfunctions')
dynamodb = boto3.resource('dynamodb', region_name='us-east-1')
dynamodb = boto3.resource('dynamodb', region_name=REGION)

def mask_sensitive_data(event):
# remove sensitive data from request object before logging
Expand Down
4 changes: 2 additions & 2 deletions deploy/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f598ef3

Please sign in to comment.