Search code examples
mysqlamazon-web-servicesamazon-auroraaws-aurora-serverless

How to upgrade Aurora serverless MySQL cluster from 5.6 to 5.7 when using CloudFormation


I have Aurora serverless MySQL cluster running engine version 5.6. It is set up using CloudFormation.

What is the best way to upgrade the cluster to support MySQL 5.7?

I tried changing EngineVersion from 5.6 to 5.7, and engine from aurora to aurora-mysql as well as specifying new parameter group for 5.7.

Updating the stack with these changes returns an error:

In-place upgrade of the engine to a new major version isn't supported on serverless engine mode. (Service: AmazonRDS; Status Code: 400; Error Code: InvalidDBClusterStateFault;

I don't trust this error as this shouldn't be a major version and what documentation I can find supports the idea that this should be possible.

Below is the CloudFormation code snippet, excluding irrelevant properties:

  RDSDBClusterParameterGroup:
    Type: 'AWS::RDS::DBClusterParameterGroup'
    Properties:
      Description: Aurora Cluster Parameter Group for aurora-mysql5.7
      Family: aurora-mysql5.7
      Parameters:
        general_log: '0'
  RDSCluster:
    Type: 'AWS::RDS::DBCluster'
    DependsOn: 
      - RDSDBClusterParameterGroup
    Properties:   
      DBClusterParameterGroupName: 
        Ref: RDSDBClusterParameterGroup
      Engine: aurora-mysql
      EngineMode: serverless
      EngineVersion: 5.7
      [..]

Solution

  • I wasn't able to perform an upgrade. It counts as a major version since we are upgrading from Aurora serverless V1 to V2.

    Was a bit complicated to find the best solution since I had to use CFN.

    Resolved it like this:

    1. using console created snapshot from existing 5.6 cluster
    2. restored snapshot to a new 5.7 supported cluster (Aurora serverless v2)
    3. imported the new cluster resource in the existing CFN stack
    4. updated the template in my pipeline and run deployment again(no changes since it is already imported)
    5. verified everything works in the new cluster and all data is present.
    6. deleted the old v1 (5.6) cluster from the template and stack.