Skip to content

Commit

Permalink
fix: aws secrets manager prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
MatanYadaev committed Aug 1, 2024
1 parent 4b7d5b1 commit 8750906
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
2 changes: 1 addition & 1 deletion services/workflows-service/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const serverEnvSchema = {
AWS_SECRETS_MANAGER_PREFIX: z
.string()
.optional()
.default('customers')
.default('/dev/customers/')
.describe('AWS Secrets Manager prefix'),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -106,6 +96,6 @@ export class AwsSecretsManager implements SecretsManager {
}

private getSecretName() {
return `/${this.environmentName}/${this.prefix}/${this.customerId}`;
return `${this.prefix}${this.customerId}`;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down

0 comments on commit 8750906

Please sign in to comment.