From 875090662c283f23c31ed5fa456cfd9034d6b6f2 Mon Sep 17 00:00:00 2001 From: Matan Yadaev Date: Thu, 1 Aug 2024 10:27:25 +0300 Subject: [PATCH] fix: aws secrets manager prefix --- services/workflows-service/src/env.ts | 2 +- .../src/secrets-manager/aws-secrets-manager.ts | 14 ++------------ .../src/secrets-manager/secrets-manager.factory.ts | 1 - 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/services/workflows-service/src/env.ts b/services/workflows-service/src/env.ts index 0d5f66606b..c104bb824d 100644 --- a/services/workflows-service/src/env.ts +++ b/services/workflows-service/src/env.ts @@ -83,7 +83,7 @@ export const serverEnvSchema = { AWS_SECRETS_MANAGER_PREFIX: z .string() .optional() - .default('customers') + .default('/dev/customers/') .describe('AWS Secrets Manager prefix'), }; diff --git a/services/workflows-service/src/secrets-manager/aws-secrets-manager.ts b/services/workflows-service/src/secrets-manager/aws-secrets-manager.ts index cb735291b7..fa0d08e4ec 100644 --- a/services/workflows-service/src/secrets-manager/aws-secrets-manager.ts +++ b/services/workflows-service/src/secrets-manager/aws-secrets-manager.ts @@ -26,21 +26,11 @@ const SecretStringSchema = z export class AwsSecretsManager implements SecretsManager { private client: SecretsManagerClient; - private environmentName: string; private prefix: string; private customerId: string; - constructor({ - environmentName, - prefix, - customerId, - }: { - environmentName: string; - prefix: string; - customerId: string; - }) { + constructor({ prefix, customerId }: { prefix: string; customerId: string }) { this.client = new SecretsManagerClient(); - this.environmentName = environmentName; this.prefix = prefix; this.customerId = customerId; } @@ -106,6 +96,6 @@ export class AwsSecretsManager implements SecretsManager { } private getSecretName() { - return `/${this.environmentName}/${this.prefix}/${this.customerId}`; + return `${this.prefix}${this.customerId}`; } } diff --git a/services/workflows-service/src/secrets-manager/secrets-manager.factory.ts b/services/workflows-service/src/secrets-manager/secrets-manager.factory.ts index af4ac7335a..29e8b084df 100644 --- a/services/workflows-service/src/secrets-manager/secrets-manager.factory.ts +++ b/services/workflows-service/src/secrets-manager/secrets-manager.factory.ts @@ -12,7 +12,6 @@ export class SecretsManagerFactory { case 'aws-secrets-manager': return new AwsSecretsManager({ customerId, - environmentName: env.ENVIRONMENT_NAME, prefix: env.AWS_SECRETS_MANAGER_PREFIX, }); case 'in-memory':