Skip to content

Commit

Permalink
Merge pull request #38 from vincentclaes/37-better-region-handling
Browse files Browse the repository at this point in the history
37 better region handling
  • Loading branch information
vincentclaes authored Feb 25, 2021
2 parents 524115a + f9e8e26 commit 828f718
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions datajob/stepfunctions/stepfunctions_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ def __init__(
if role is None
else role
)
self.region = region if region else os.environ["AWS_DEFAULT_REGION"]
self.region = (
region if region is not None else os.environ.get("AWS_DEFAULT_REGION")
)

def add_task(self, task_other):
"""add a task to the workflow we would like to orchestrate."""
Expand Down Expand Up @@ -86,7 +88,7 @@ def _build_workflow(self):
)
workflow_definition = steps.Chain(self.chain_of_tasks)
logger.debug(f"creating a workflow with name {self.unique_name}")
self.client = boto3.client("stepfunctions", region_name=self.region)
self.client = boto3.client("stepfunctions")
self.workflow = Workflow(
name=self.unique_name,
definition=workflow_definition,
Expand Down

0 comments on commit 828f718

Please sign in to comment.