-
Recently I have been using Amazon Aurora PostgreSQL Serverless. As I have spun up more instances, I have recognized that there are some parameters in the parameter group that I want to adjust (for instance, This turns out to be a really weird and tricky thing to do "well" with CDK (specifically with Serverless). Basically, there are a number of interesting hurdles:
The ONLY way I could figure out how to get this to work was by building a parameter group using a specific AuroraPostgresEngineVersion Here is an example in Python: parameter_group = rds.ParameterGroup(
self,
"ParameterGroup",
engine=rds.DatabaseClusterEngine.aurora_postgres(
version=rds.AuroraPostgresEngineVersion.VER_10_14
),
parameters={
"rds.force_ssl": "1"
}
) From there, I can create a ServerlessCluster: cluster = rds.ServerlessCluster(
self,
"Database",
engine=rds.DatabaseClusterEngine.AURORA_POSTGRESQL,
vpc=database_stack_props["vpc"],
backup_retention=cdk.Duration.days(7),
default_database_name="postgres",
enable_data_api=True,
parameter_group=parameter_group,
removal_policy=cdk.RemovalPolicy.SNAPSHOT,
vpc_subnets=ec2.SubnetSelection(subnet_type=ec2.SubnetType.ISOLATED),
) Overall, it feels a bit weird to specify a specific version, because I don't actually know what version Amazon Aurora PostgreSQL Serverless is using behind the scenes. Has anyone else solved this in a more graceful way? If not, I think there could be a few ways to make this a bit nicer from a CDK perspective:
Are there any other better options or does anyone else have any good ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hey @AjkayAlan , this is actually an RDS limitation. While you can create a Serverless PostgreSQL cluster without providing it a specific version, you cannot create a PostgreSQL ParameterGroup that doesn't specify a (major) version. We strongly advise providing a version also when creating the Cluster. Not providing it is actually an availability risk, like we say in the documentation of Thanks, |
Beta Was this translation helpful? Give feedback.
-
Hmm, you're right @AjkayAlan . I was actually under the impression that more versions supported Serverless than just Can you open us an issue about this? We'll have to think how to best tackle this on our end.
This is the risk you run always with RDS. RDS constantly changes the supported versions of their databases. The difference is that if you don't pin to a specific version, RDS will do this migration for you, under the scenes, without you knowing about it. If you pin, you're in control when this migration happens. |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Hmm, you're right @AjkayAlan . I was actually under the impression that more versions supported Serverless than just
10.12
, but apparently I was wrong.Can you open us an issue about this? We'll have to think how to best tackle this on our end.
This is the risk you run always with RDS. RDS constantly changes the supported versions of their databases. The difference is that if you don't pin to a specific version, RDS will do this migration for you, under the scenes, without you knowing about it. If you pin, you're in control when this migration happens.