2.2.5 • Published 8 months ago

@trxn/terraform-service-postgres v2.2.5

Weekly downloads
-
License
-
Repository
github
Last release
8 months ago

terraform-service-postgres

Provides a database service with a single Postgres container.

Configuration example

const postgres = new PostgresComponent(this, 'postgres', {
  containerConfig: {
    imageTag: '13-alpine',
    environments: {
      POSTGRES_DB: 'api',
      POSTGRES_USER: Secret(),
      POSTGRES_PASSWORD: Secret(),
    },
  },
  desiredCount: 1,
  cpu: '256',
  memory: '512',
});

Backups

This service also provide a backup system based on image tractr/postgres-backup which is based on blacklabelops/volumerize. This last one is able to store backups on many providers. By default, this service stores the backups on a persistent container Volume, i.e. on AWS EFS using the VolumeComponent. This EFS is also backup by AWS by using the Automatic backup option.

You may want to store backups on another providers. See the Volumerize documentation for more examples. This is an exemple that stores backups on AWS S3:

const postgres = new PostgresComponent(this, 'postgres', {
  containerConfig: {
    imageTag: '13-alpine',
    environments: {
      POSTGRES_DB: 'api',
      POSTGRES_USER: Secret(),
      POSTGRES_PASSWORD: Secret(),
    },
  },
  enableBackups: true,
  backupsConfig: {
    imageTag: 'v1.7',
    environments: {
      VOLUMERIZE_SOURCE: '/source',
      VOLUMERIZE_TARGET: 's3://s3.eu-central-1.amazonaws.com/duplicitytest',
      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_NAME3: 'CleanupBackups',
      JOB_COMMAND3: '/etc/volumerize/cleanup --force',
      JOB_TIME3: '0 0 3 * * *',
      AWS_ACCESS_KEY_ID: 'QQWDQIWIDO1QO',
      AWS_SECRET_ACCESS_KEY: 'ewlfkwkejflkjwlkej3fjw381',
      POSTGRES_USER: Secret(),
      POSTGRES_PASSWORD: Secret(),
      POSTGRES_HOST: (service) => service.getServiceDomainName('postgres'),
      POSTGRES_PORT: '5432',
      POSTGRES_DB: 'api',
    },
  },
  desiredCount: 1,
  cpu: '256',
  memory: '512',
});
2.2.3

10 months ago

2.2.5

8 months ago

2.2.4

9 months ago

2.2.1

12 months ago

2.2.2

12 months ago

2.2.0

1 year ago

2.1.14

1 year ago

2.2.0-next.2

1 year ago

2.2.0-next.3

1 year ago

2.1.14-next.0

1 year ago

2.1.9

1 year ago

2.1.12

1 year ago

2.1.13

1 year ago

2.1.10

1 year ago

2.1.11

1 year ago

2.2.0-next.0

1 year ago

2.2.0-next.1

1 year ago

2.1.4

1 year ago

2.1.6

1 year ago

2.1.5

1 year ago

2.1.8

1 year ago

2.1.7

1 year ago

2.1.0-next.1

1 year ago

2.1.0-next.0

1 year ago

2.1.2

1 year ago

2.1.1

1 year ago

2.1.3

1 year ago

2.1.0

1 year ago

2.0.11-next.1

1 year ago

2.0.11-next.0

1 year ago

2.0.11-next.3

1 year ago

2.0.11-next.2

1 year ago

2.0.13

1 year ago

2.0.11

1 year ago

2.0.12

1 year ago

2.0.9

1 year ago

2.0.10

1 year ago

2.0.8

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.7

1 year ago

2.0.6

1 year ago

2.0.0-next.2

1 year ago

2.0.0-next.0

1 year ago

2.0.0-next.1

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.65.13-next.4

1 year ago

1.65.13-next.5

1 year ago

1.65.11-beta.3

1 year ago

1.65.3

1 year ago

1.65.13-next.2

1 year ago

1.65.4

1 year ago

1.65.5

1 year ago

1.65.13-next.8

1 year ago

1.65.6

1 year ago

1.65.11-next.0

1 year ago

1.65.7

1 year ago

1.65.13-next.6

1 year ago

1.65.8

1 year ago

1.65.13-next.7

1 year ago

1.65.9

1 year ago

1.65.10

1 year ago

1.65.12

1 year ago

1.65.11

1 year ago

1.65.13-next.0

1 year ago

1.65.11-beta.0

1 year ago

1.65.13-next.1

1 year ago

1.65.11-beta.2

1 year ago

1.65.11-beta.1

1 year ago

1.65.2

1 year ago