awslabs/aws-rails-provisioner

ClusterParameterGroup no longer exists

Closed this issue · 9 comments

In the generated fargate stack definition it references ClusterParameterGroup here: https://github.com/awslabs/aws-rails-provisioner/blob/master/templates/fargate_stack.mustache#L37 and here: https://github.com/awslabs/aws-rails-provisioner/blob/master/templates/fargate_stack.mustache#L37

This gives the following error:

lib/rails-foo-fargate-stack.ts:37:43 - error TS2339: Property 'ClusterParameterGroup' does not exist on type 'typeof import("/Users/nweinmeister/Programming/FDIC/test-rails-deploy/cdk-sample/node_modules/@aws-cdk/aws-rds/lib/index")'.

37         const clusterParameterGroup = rds.ClusterParameterGroup.fromParameterGroupName(
                                             ~~~~~~~~~~~~~~~~~~~~~

ClusterParameterGroup no longer exists. I manually replaced it with rds.ParameterGroup and it works fine.

I'm happy to submit a PR to replace this if necessary.

Are you using the latest CDK? That's strange that it would be removed, that sounds like a breaking change.

We're happy to take a PR to replace it with ParameterGroup.

Hey @nweinmeister,

You are correct, ClusterParameterGroup was removed in the last release due to being a functional duplicate of ParameterGroup.

They should be hot-swappable but lmk if they aren't!

😸 😷

@mullermp Sorry missed your comments earlier. But thanks for fixing that! Definitely liking this gem so far for our infrastructure setup 👍

Hi,
my old code is breaking now please can someone help me with how to update or replace this rds.ClusterParameterGroup with rds.ParameterGroup :

const dbParameterGroup = new rds.ClusterParameterGroup(this, "dbParameterGroup", {
     description: "Postgres SSL Enabled Parameter Group",
     family: postgresDatabaseParameterGroupFamily,
     parameters: {
       "max_connections": "100",
       "rds.force_ssl": "1",
       "ssl": "1",
     },
   });

New code:


  const ParameterGroupProps= new rds.ParameterGroupProps("Postgres SSL Enabled Parameter Group", postgresDatabaseParameterGroupFamily, {
      parameters: { 
      "max_connections": "100",
      "rds.force_ssl": "1",
      "ssl": "1",
    }, 
  });
    const dbParameterGroup = new rds.ParameterGroup(this, "dbParameterGroup", ParameterGroupProps )
   

cdk ls


/Users/ashishkarpe/code/operations/citus-db-migration/deploy/cdk/node_modules/ts-node/src/index.ts:434
    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
lib/database-stack.ts:74:40 - error TS2339: Property 'ParameterGroupProps' does not exist on type 'typeof import("/Users/ashishkarpe/code/operations/citus-db-migration/deploy/cdk/node_modules/@aws-cdk/aws-rds/lib/index")'.

74     const ParameterGroupProps= new rds.ParameterGroupProps("Postgres SSL Enabled Parameter Group", postgresDatabaseParameterGroupFamily, {
                                          ~~~~~~~~~~~~~~~~~~~

Also tried:


const dbParameterGroup = new rds.ParameterGroup(this, "dbParameterGroup", {
description: "Postgres SSL Enabled Parameter Group",
family: postgresDatabaseParameterGroupFamily,
parameters: {
"max_connections": "100",
"rds.force_ssl": "1",
"ssl": "1",
},
});

getting error: cdk ls


/Users/ashishkarpe/code/operations/citus-db-migration/deploy/cdk/node_modules/ts-node/src/index.ts:434
    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
lib/database-stack.ts:96:7 - error TS2345: Argument of type '{ description: string; family: string; parameters: { max_connections: string; "rds.force_ssl": string; ssl: string; }; }' is not assignable to parameter of type 'ParameterGroupProps'.
  Object literal may only specify known properties, and 'family' does not exist in type 'ParameterGroupProps'.
96       family: postgresDatabaseParameterGroupFamily,
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/database-stack.ts:108:11 - error TS2739: Type 'Duration' is missing the following properties from type 'Duration': isUnresolved, unitLabel, formatTokenToNumber
108           retention: cdk.Duration.days(30),
              ~~~~~~~~~
lib/database-stack.ts:111:44 - error TS2339: Property 'AURORA_POSTGRESQL' does not exist on type 'typeof DatabaseInstanceEngine'.
111         engine: rds.DatabaseInstanceEngine.AURORA_POSTGRESQL,
                

used this which worked for me sharing here so may help if someone needed


const dbParameterGroup = new CfnDBClusterParameterGroup(
  this,
  "ParameterGroup",
  {
    family: "aurora5.6",
    description: "My Aurora Database Parameters.",
    parameters: {
      innodb_large_prefix: "1",
      innodb_file_per_table: "1",
      innodb_file_format: "Barracuda",
      character_set_client: "utf8mb4",
      character_set_connection: "utf8mb4",
      character_set_database: "utf8mb4",
      character_set_results: "utf8mb4",
      character_set_server: "utf8mb4",
      collation_server: "utf8mb4_unicode_ci",
      collation_connection: "utf8mb4_unicode_ci"
    }
  }
);