diff --git a/datajob/stepfunctions/stepfunctions_workflow.py b/datajob/stepfunctions/stepfunctions_workflow.py index 1512c8e..102aea3 100644 --- a/datajob/stepfunctions/stepfunctions_workflow.py +++ b/datajob/stepfunctions/stepfunctions_workflow.py @@ -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.""" @@ -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,