https://pulumi.com logo
Title
f

flat-oil-27395

03/30/2021, 7:23 PM
Hi, I'm setting up an API Gateway and my routes are Lambdas with the cloud API (https://github.com/pulumi/pulumi-cloud) in typescript, and within a route I'm trying to access dynamodb, but I keep getting errors saying my lambda doesnt have the correct role to access my dynamodb, I've yet to find way to attach a role to a lambda using the cloud API, any suggestions?
b

brave-planet-10645

03/31/2021, 8:47 AM
Is there a specific reason you're using the cloud provider as opposed to the AWS provider or AWSX library?
f

flat-oil-27395

04/03/2021, 5:05 PM
Simply for ease of use. Doesn't seem like policy customization is available for cloud provider, is there any plan to support that in the future? In the meantime I'm, switching to the awsx provide, but the only way I'm seeing to attach a policy is via the restApiArgs and policy attr which is a json string... seems cumbersome, is there a better way?
I managed to set policies using this function: https://github.com/pulumi/pulumi-cloud/blob/f11a3ff7fad540443c4006eafcf707b5d17a1005/aws/shared.ts#L101, is that a recommended way of doing it?