Example #1
0
    def execute(self, context: 'Context'):
        hook = StepFunctionHook(aws_conn_id=self.aws_conn_id, region_name=self.region_name)

        execution_status = hook.describe_execution(self.execution_arn)
        execution_output = json.loads(execution_status['output']) if 'output' in execution_status else None

        self.log.info('Got State Machine Execution output for %s', self.execution_arn)

        return execution_output
Example #2
0
    def test_describe_execution(self):
        hook = StepFunctionHook(aws_conn_id='aws_default',
                                region_name='us-east-1')
        state_machine = hook.get_conn().create_state_machine(
            name='pseudo-state-machine',
            definition='{}',
            roleArn='arn:aws:iam::000000000000:role/Role')

        state_machine_arn = state_machine.get('stateMachineArn', None)

        execution_arn = hook.start_execution(
            state_machine_arn=state_machine_arn,
            name=None,
            state_machine_input={})
        response = hook.describe_execution(execution_arn)

        assert 'input' in response