Skip to content
Open
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
26 changes: 9 additions & 17 deletions libs/terraform/service/postgres/src/lib/configs/postgres.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,20 @@ export const POSTGRES_COMPONENT_DEFAULT_CONFIG: PostgresComponentDefaultConfig =
},
enableBackups: false,
backupsConfig: {
imageName: 'tractr/postgres-backup',
imageTag: 'v1.7',
imageName: 'fekide/volumerize',
imageTag: '1.8.2-postgres',
environments: {
VOLUMERIZE_SOURCE: '/source',
VOLUMERIZE_TARGET: 'file:///backups',
VOLUMERIZE_JOBBER_TIME: '0 0 */4 * * *',
VOLUMERIZE_FULL_IF_OLDER_THAN: '3D',
JOB_NAME2: 'RemoveOldBackups',
JOB_COMMAND2: '/etc/volumerize/remove-older-than 1M --force',
JOB_TIME2: '0 0 2 * * *',
JOB_NOTIFY_ERR2: 'true',
JOB_NOTIFY_FAIL2: 'true',
JOB_NAME3: 'CleanupBackups',
JOB_COMMAND3: '/etc/volumerize/cleanup --force',
JOB_TIME3: '0 0 3 * * *',
JOB_NOTIFY_ERR3: 'true',
JOB_NOTIFY_FAIL3: 'true',
POSTGRES_DB: 'api',
POSTGRES_USER: Secret(),
POSTGRES_PASSWORD: Secret(),
POSTGRES_HOST: (service) => service.getServiceDomainName('postgres'),
POSTGRES_PORT: '5432',
REMOVE_OLDER_THAN: '30D',
VOLUMERIZE_POSTGRES_DATABASE: 'api',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be Secret('POSTGRES_DB'), by default ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we set it to Secret('POSTGRES_DB') we will have to add the key POSTGRES_DB in AWS secret manager.

VOLUMERIZE_POSTGRES_USERNAME: Secret('POSTGRES_USER'),
VOLUMERIZE_POSTGRES_PASSWORD: Secret('POSTGRES_PASSWORD'),
VOLUMERIZE_POSTGRES_HOST: (service) =>
service.getServiceDomainName('postgres'),
VOLUMERIZE_POSTGRES_PORT: '5432',
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,13 @@ export interface BackupContainerPublicConfig extends ContainerPublicConfig {
VOLUMERIZE_TARGET: EnvironmentOrSecretValue;
VOLUMERIZE_JOBBER_TIME: EnvironmentOrSecretValue;
VOLUMERIZE_FULL_IF_OLDER_THAN: EnvironmentOrSecretValue;
JOB_NAME2?: EnvironmentOrSecretValue;
JOB_COMMAND2?: EnvironmentOrSecretValue;
JOB_TIME2?: EnvironmentOrSecretValue;
JOB_NOTIFY_ERR2?: EnvironmentOrSecretValue;
JOB_NOTIFY_FAIL2?: EnvironmentOrSecretValue;
JOB_NAME3?: EnvironmentOrSecretValue;
JOB_COMMAND3?: EnvironmentOrSecretValue;
JOB_TIME3?: EnvironmentOrSecretValue;
JOB_NOTIFY_ERR3?: EnvironmentOrSecretValue;
JOB_NOTIFY_FAIL3?: EnvironmentOrSecretValue;
AWS_ACCESS_KEY_ID?: EnvironmentOrSecretValue;
AWS_SECRET_ACCESS_KEY?: EnvironmentOrSecretValue;
POSTGRES_USER: EnvironmentOrSecretValue;
POSTGRES_PASSWORD: EnvironmentOrSecretValue;
POSTGRES_HOST: EnvironmentOrSecretValue;
POSTGRES_PORT: EnvironmentOrSecretValue;
POSTGRES_DB: EnvironmentOrSecretValue;
VOLUMERIZE_POSTGRES_USERNAME: EnvironmentOrSecretValue;
VOLUMERIZE_POSTGRES_PASSWORD: EnvironmentOrSecretValue;
VOLUMERIZE_POSTGRES_HOST: EnvironmentOrSecretValue;
VOLUMERIZE_POSTGRES_PORT: EnvironmentOrSecretValue;
VOLUMERIZE_POSTGRES_DATABASE: EnvironmentOrSecretValue;
};
}
export type BackupContainerConfig = ContainerInternalConfig &
Expand Down