Francis Menguito
05/23/2022, 12:04 PMis not authorized to perform: dynamodb:Query on resource
My lambda function cannot query my DynamoDBmanitej
05/23/2022, 12:05 PMFrancis Menguito
05/23/2022, 12:05 PMmanitej
05/23/2022, 12:06 PMFrancis Menguito
05/23/2022, 12:08 PMmanitej
05/23/2022, 12:09 PMFrancis Menguito
05/23/2022, 12:09 PMexport function ApiStack(ctx: StackContext) {
const ddb = use(StorageStack);
const api = new Api(ctx.stack, "Api", {
routes: {
...customer_routes,
...order_routes,
...payout_routes,
...product_routes,
...store_routes,
...transaction_routes,
},
defaults: {
function: {
environment: {
storesTableName: ddb.storesTable.tableName,
payoutsTableName: ddb.payoutsTable.tableName,
},
},
},
});
ctx.stack.addOutputs({
ApiEndpoint: api.url,
});
}
Francis Menguito
05/23/2022, 12:10 PMmanitej
05/23/2022, 12:11 PMfunction: {
permissions: [ddb]
Francis Menguito
05/23/2022, 12:12 PMmanitej
05/23/2022, 12:13 PMdefaults: {
function: {
// Pass in the table name to our API
environment: {
....
},
permissions: [ddb],
},
}
manitej
05/23/2022, 12:13 PMFrancis Menguito
05/23/2022, 12:15 PMdefaults: {
function: {
environment: {
storesTableName: ddb.storesTable.tableName,
payoutsTableName: ddb.payoutsTable.tableName,
},
permissions: [ddb.storesTable, ddb.payoutsTable],
},
},
The code above has an errorFrancis Menguito
05/23/2022, 12:15 PMmanitej
05/23/2022, 12:20 PMFrancis Menguito
05/23/2022, 12:22 PMFrancis Menguito
05/23/2022, 12:23 PMmanitej
05/23/2022, 12:23 PM