1010
1111from .exceptions import NoItemFound
1212
13- dynamodb = boto3 .client ("dynamodb" )
14- s3 = boto3 .client ("s3" )
13+ dynamodb = boto3 .client (
14+ "dynamodb" , endpoint_url = os .environ .get ("DYNAMODB_ENDPOINT_URL" )
15+ )
16+ s3 = boto3 .client ("s3" , endpoint_url = os .environ .get ("S3_ENDPOINT_URL" ))
1517
1618#: If an item's data is larger than this threshold it will be stored in S3 instead of
1719#: DynamoDB. The item limit is 400KB but we'll leave room for other attributes.
@@ -42,6 +44,7 @@ class StateDataClient:
4244 tasks to use to store data remotely instead of passing it directly to downstream
4345 states in the state machine input data object. This is handy when the state data is
4446 larger than 32K characters (the AWS limit).
47+
4548 """
4649
4750 def __init__ (
@@ -74,7 +77,9 @@ def __init__(
7477 self .default_table_name = default_table_name
7578 self .namespace = namespace
7679 self .ttl_days = ttl_days
77- self .s3_bucket = boto3 .resource ("s3" ).Bucket (s3_bucket )
80+ self .s3_bucket = boto3 .resource (
81+ "s3" , endpoint_url = os .environ .get ("S3_ENDPOINT_URL" )
82+ ).Bucket (s3_bucket )
7883
7984 def table (self , table_name : str ) -> "dynamodb.Table" :
8085 """Helper method to create a DynamoDB table object.
@@ -86,7 +91,9 @@ def table(self, table_name: str) -> "dynamodb.Table":
8691 DynamoDB table object
8792
8893 """
89- return boto3 .resource ("dynamodb" ).Table (table_name )
94+ return boto3 .resource (
95+ "dynamodb" , endpoint_url = os .environ .get ("DYNAMODB_ENDPOINT_URL" )
96+ ).Table (table_name )
9097
9198 def _load_item_data (self , item : Dict ) -> Any :
9299 """Load item data for a given item metadata dict.
0 commit comments