0
votes

I'm implementing a workflow with AmazonSWF and one of my activities comes in the form of a lambda function.

Both SWF and Lambda are being run on the London region, where they both work separately. However, my decider after polling for the task, it fails with the cause "LAMBDA_SERVICE_NOT_AVAILABLE_IN_REGION"

I haven't explicitly specified which region I'm working from in code, I assumed it would be the same one that I run the SWF web client in.

Here's the relevant code in my decider:

val attrs = ScheduleLambdaFunctionDecisionAttributes()
                        .withId("S3ControlWorkflowFunction")
                        .withName("S3ControlWorkflowFunction")
                decisions.add(
                        Decision()
                                .withDecisionType(DecisionType.ScheduleLambdaFunction)
                                .withScheduleLambdaFunctionDecisionAttributes(attrs)
                )

My activity worker doesn't do anything at all for the lambda function, but it shouldn't have to right?

I've registered the workflow with my IAM role here:

wf.registerWorkflowType(RegisterWorkflowTypeRequest()
                    .withDomain(DOMAIN)
                    .withName(WORKFLOW)
                    .withVersion(WORKFLOW_VERSION)
                    .withDefaultChildPolicy(ChildPolicy.TERMINATE)
                    .withDefaultTaskList(TaskList().withName(TASKLIST))
                    .withDefaultTaskStartToCloseTimeout("30")
                    .withDefaultLambdaRole(iamARN.id))
1

1 Answers

0
votes

Found the fix.

Turns out calling lambda functions from SWF just isn't supported on region eu-west-2, as well as a few others. However I can't find any reference to this at all in the documentation. Found this forum post which gave me the hint. Migrating all the work I'd done over to eu-west-1 solved the issue. Poor show from Amazon here