mikemaccana
mikemaccana

Reputation: 123325

How can I fix 'DB Clusters not supported for engine' when restoring a snapshot on AWS Aurora?

I'm using the AWS API to restore a cluster snapshot. My code is simple enough, and follows the restoreDBClusterFromSnapshot documentation fairly closely:

await rds.restoreDBClusterFromSnapshot({
  DBClusterIdentifier: SNAPSHOT_NAME,
  SnapshotIdentifier: `arn:aws:rds:eu-west-1:ACCOUNT_ID:cluster-snapshot:SNAPSHOT_NAME`,
  Engine: "postgres",
  EngineMode: 'provisioned',
  EngineVersion: '9.6.12',
  Tags: [
    {
      Key: 'Creator',
      Value: USERNAME
    }
  ]
}).promise()

However this call fails with

DB Clusters not supported for engine: postgres

I know that's not true - we're running a Postgres Cluster in production.

How can I restore the cluster snapshot?

Upvotes: 0

Views: 2260

Answers (1)

mikemaccana
mikemaccana

Reputation: 123325

The error is a little deceptive - it's not that clusters aren't available for postgres engine, is that postgres isn't a valid engine name.

The correct name for AWS postgres engine is aurora-postgresql. I wasn't able to find any mention of this in the AWS documentation however:

  1. Running rds.describeDBClusters() on the existing cluster made through the Management Console shows the Engine as aurora-postgresql.

  2. The TypeScript info for createDBInstance() mentions:

Valid Values: aurora (for MySQL 5.6-compatible Aurora) aurora-mysql (for MySQL 5.7-compatible Aurora) aurora-postgresql mariadb mysql oracle-ee oracle-se2 oracle-se1 oracle-se postgres sqlserver-ee sqlserver-se sqlserver-ex sqlserver-web

await rds.restoreDBClusterFromSnapshot({
  DBClusterIdentifier: SNAPSHOT_NAME,
  SnapshotIdentifier: `arn:aws:rds:eu-west-1:ID_NUMBER:cluster-snapshot:${SNAPSHOT_NAME}`,
  Engine: "aurora-postgresql",
  EngineMode: 'provisioned',
  EngineVersion: '9.6.12',
  Tags: [
    {
      Key: 'Creator',
      Value: USERNAME
    }
  ]
}).promise()

Upvotes: 1

Related Questions