release/2026-04-03 - Clean up localstack endpoints / env check

This commit is contained in:
Dave
2026-04-01 14:39:34 -04:00
parent efdcd06921
commit 7688f22161
7 changed files with 73 additions and 44 deletions

View File

@@ -5,7 +5,8 @@ const logger = require("../utils/logger");
const fs = require("fs");
const { SecretsManagerClient, GetSecretValueCommand } = require("@aws-sdk/client-secrets-manager");
const { defaultProvider } = require("@aws-sdk/credential-provider-node");
const { isString, isEmpty } = require("lodash");
const { InstanceIsLocalStackEnabled, InstanceLocalStackEndpoint } = require("../utils/instanceMgr");
let Client = require("ssh2-sftp-client");
const client = require("../graphql-client/graphql-client").client;
@@ -151,10 +152,8 @@ async function getPrivateKey() {
credentials: defaultProvider()
};
const isLocal = isString(process.env?.LOCALSTACK_HOSTNAME) && !isEmpty(process.env?.LOCALSTACK_HOSTNAME);
if (isLocal) {
secretsClientOptions.endpoint = `http://${process.env.LOCALSTACK_HOSTNAME}:4566`;
if (InstanceIsLocalStackEnabled()) {
secretsClientOptions.endpoint = InstanceLocalStackEndpoint();
}
const client = new SecretsManagerClient(secretsClientOptions);