sparse-intern-71089
01/21/2021, 12:14 AMbrave-planet-10645
01/21/2021, 11:17 AMRestApiPolicy
, there is an extra property available in `restApiArgs`called policy. Looking at the docs I think it does the same as the RestApiPolicy
.
It takes a policy as json but you can do something like the following (this is an example policy so obviously swap it for your own one):
const policy = aws.iam.getPolicyDocument({
statements: [{
actions: ["dynamodb:*"],
effect: "Allow",
resources: ["*"]
}]
});
const api = new awsx.apigateway.API("my-api",{
routes: [{
path: "/",
method: "GET",
eventHandler: async (event) => {
// This code runs in an AWS Lambda and will be invoked any time `/` is hit.
return {
statusCode: 200,
body: "hello",
};
},
}],
restApiArgs: {
endpointConfiguration: {
types: "PRIVATE",
vpcEndpointIds: [execApiVpcEndpointId]
},
policy: policy.then(policy => policy.json)
},
});
Try that and let me know if it workslively-ice-73493
01/21/2021, 2:59 PMbrave-planet-10645
01/21/2021, 3:02 PMlively-ice-73493
01/21/2021, 4:40 PMbrave-planet-10645
01/21/2021, 4:46 PMlively-ice-73493
01/21/2021, 4:49 PMbrave-planet-10645
01/21/2021, 4:49 PMlively-ice-73493
01/21/2021, 4:50 PMlively-ice-73493
01/21/2021, 4:51 PMlively-ice-73493
01/21/2021, 4:52 PMbrave-planet-10645
01/21/2021, 4:54 PMlively-ice-73493
01/21/2021, 4:56 PMlively-ice-73493
01/21/2021, 4:56 PMrestApiArgs
brave-planet-10645
01/21/2021, 4:58 PMlively-ice-73493
01/25/2021, 8:44 PMpulumi up
twice on the initial deploy. Subsequent deploys work on a single run, weird.