AWS Data API RDSDataClient Args in Production

Trying to wrap my head around how this should work in a lambda environment in production
const rdsClient = new RDSDataClient({
credentials: fromIni({ profile: process.env['PROFILE'] }),
region: "us-east-1",
});

const dataApiArgs = {
database: process.env["DB_SERVERLESS_NAME"]!,
secretArn: process.env["DB_SECRET_ARN"]!,
resourceArn: process.env["DB_RESOURCE_ARN"]!,
logger,
};

export const DB = dataApiDrizzle(rdsClient, dataApiArgs);
const rdsClient = new RDSDataClient({
credentials: fromIni({ profile: process.env['PROFILE'] }),
region: "us-east-1",
});

const dataApiArgs = {
database: process.env["DB_SERVERLESS_NAME"]!,
secretArn: process.env["DB_SECRET_ARN"]!,
resourceArn: process.env["DB_RESOURCE_ARN"]!,
logger,
};

export const DB = dataApiDrizzle(rdsClient, dataApiArgs);
Is the Lambda really supposed to have AWS CLI credentials?
2 Replies
McLean 25
McLean 25OP15mo ago
I'm assuming the correct way to do this is to give my lambda's access to the DataAPI
Angelelz
Angelelz13mo ago
How could it query your data without access to it?
Want results from more Discord servers?
Add your server