Reputation: 33
I'm trying to use environment variables stored in AWS Secrets Manager in my Next.js application, but I'm having trouble accessing them correctly. I'm using Next.js 14.
// utils/aws.js
import AWS from "aws-sdk";
const client = new AWS.SecretsManager({
region: "ap-south-1",
});
export async function getSecret() {
const { SecretString } = await client
.getSecretValue({
SecretId: "my-secret",
})
.promise();
return SecretString;
}
However, when I try to run the application, I get an error
UnhandledPromiseRejectionWarning: Missing credentials in config.
Upvotes: 0
Views: 234