dazzling-scientist-80826
04/18/2019, 5:57 PMwhite-balloon-205
dazzling-scientist-80826
04/18/2019, 6:00 PMnew ApiGateway
, it is snappyconst gateway = new WebSocketGateway('gateway')
white-balloon-205
dazzling-scientist-80826
04/18/2019, 6:04 PMwhite-balloon-205
const client = new apigatewayv2();
From being outside of the create
callback to being inside the create
callback.
It's a little involved why this makes such a big difference, but in short - dynamic providers take advantage of the same "function serialization" logic we use for turning callbacks into Lambdas (documented https://pulumi.io/reference/serializing-functions.html). To serialize the reference to the client
defined outside of the callback, it looks like we effectively have to serialize a large part of the AWS SDK, and this takes a long time (as it's not really optimized for this).
The experience here isn't ideal - it would be preferable to error instead of hang for so long for example. But the workaround should be simple.dazzling-scientist-80826
04/18/2019, 6:22 PMwhite-balloon-205
dazzling-scientist-80826
04/18/2019, 6:41 PM