Skip to content

Commit 9e7e072

Browse files
authored
Merge pull request #178 from MartinBarker/dynamicAwsLocation
dynamic us-west deploy env
2 parents 2a51695 + 3f4fe42 commit 9e7e072

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1638,7 +1638,8 @@ async function getAwsSecret(secretName, maxRetries = 3) {
16381638
for (let attempt = 1; attempt <= maxRetries; attempt++) {
16391639
try {
16401640
console.log(`Attempt ${attempt}/${maxRetries} for secret: ${secretName}`);
1641-
const awsClient = new SecretsManagerClient({ region: "us-west-1" });
1641+
const region = process.env.AWS_REGION || process.env.AWS_DEFAULT_REGION || "us-west-2";
1642+
const awsClient = new SecretsManagerClient({ region });
16421643
console.log('AWS Secrets Manager client created');
16431644

16441645
const command = new GetSecretValueCommand({

0 commit comments

Comments
 (0)