Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres Manager Enhancement #149

Merged
merged 3 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/workload/stateless/postgres_manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ There are 4 lambdas in this stack:

2. `orcabus-create-pg-login-role`

Create a role with login credentials used for this microservice.
Create a role with login credentials used for the microservice to use.
The name of the role would be the microservice name itself, and the credential will be saved into the secret
manager. The secret manager name is saved to `orcabus/microservice/${microserviceName}`.
manager. The secret manager name is saved to `orcabus/${microserviceName}/rdsLoginCredential`.

Note: this will only work if the DbAuthType is configured to `USERNAME_PASSWORD`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const handler = async (event: EventType) => {
await pgClient.end();

// store the new db config at secret manager
const secretName = `orcabus/${microserviceName}/rdsLoginCredential`; // pragma: allowlist secret
const secretValue = createSecretValue({
password: password,
host: pgMasterConfig.host,
Expand All @@ -60,7 +61,7 @@ export const handler = async (event: EventType) => {
});

const smInput: CreateSecretCommandInput = {
Name: `orcabus/microservice/${microserviceName}`,
Name: secretName,
Description: `orcabus microservice secret for '${microserviceName}'`,
SecretString: JSON.stringify(secretValue),
Tags: [
Expand All @@ -71,9 +72,7 @@ export const handler = async (event: EventType) => {
};
const smCommand = new CreateSecretCommand(smInput);

console.info(
`storing the role credential at the secret manager (orcabus/microservice/${microserviceName})`
);
console.info(`storing the role credential at the secret manager (${secretName})`);
const response = await smClient.send(smCommand);
console.info(`ssm-response: ${JSON.stringify(response, undefined, 2)}`);
};
Expand Down
Loading