Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

Commit

Permalink
Lock the engine version of RDS aurora-postgres
Browse files Browse the repository at this point in the history
Without setting the version RDS defaults to "latest", which isn't in line
with our parameter group family, which does lock in the version. So,
explicitly lock the engine version to keep it consistent with the parameter
group.

An alternative would be to expose some sort of parameter through the yaml
and align accordingly, but given the EOL mode of GSP this is the simplest
change that will work.
  • Loading branch information
blairboy362 committed Sep 9, 2020
1 parent 0419eed commit 8e0bdd9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/service-operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ internal/aws/cloudformation/cloudformationfakes/fake_stack.go: internal/aws/clou
go generate ./internal/aws/cloudformation

# Build the docker image
docker-build: test
docker-build:
docker build . -t ${IMG}
@echo "updating kustomize image patch file for manager resource"
sed -i'' -e 's@image: .*@image: '"${IMG}"'@' ./config/default/manager_image_patch.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func init() {

const (
Engine = "aurora-postgresql"
EngineVersion = "10.13"
Family = "aurora-postgresql10"
DefaultClass = "db.r5.large"
DefaultInstanceCount = 2
Expand Down Expand Up @@ -154,6 +155,7 @@ func (p *Postgres) GetStackTemplate() (*cloudformation.Template, error) {

template.Resources[PostgresResourceCluster] = &cloudformation.AWSRDSDBCluster{
Engine: Engine,
EngineVersion: EngineVersion,
MasterUsername: masterUsernameSecretRef,
MasterUserPassword: masterPasswordSecretRef,
DBClusterParameterGroupName: cloudformation.Ref(PostgresResourceClusterParameterGroup),
Expand All @@ -180,6 +182,7 @@ func (p *Postgres) GetStackTemplate() (*cloudformation.Template, error) {
DBClusterIdentifier: cloudformation.Ref(PostgresResourceCluster),
DBInstanceClass: coalesce(p.Spec.AWS.InstanceType, DefaultClass),
Engine: Engine,
EngineVersion: EngineVersion,
PubliclyAccessible: false,
DBParameterGroupName: cloudformation.Ref(PostgresResourceParameterGroup),
Tags: tags,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ var _ = Describe("Postgres", func() {

It("should have an RDS cluster resource with sensible defaults", func() {
Expect(cluster.Engine).To(Equal("aurora-postgresql"))
Expect(cluster.EngineVersion).To(HavePrefix("10"))
Expect(cluster.DBClusterParameterGroupName).ToNot(BeEmpty())
Expect(cluster.VpcSecurityGroupIds).ToNot(BeNil())
Expect(cluster.MasterUsername).ToNot(BeEmpty())
Expand Down Expand Up @@ -247,6 +248,7 @@ var _ = Describe("Postgres", func() {
Expect(instance.PubliclyAccessible).To(BeFalse())
Expect(instance.DBInstanceClass).To(Equal("db.r5.large"))
Expect(instance.Engine).To(Equal("aurora-postgresql"))
Expect(instance.EngineVersion).To(HavePrefix("10"))
Expect(instance.Tags).To(Equal(tags))
Expect(instance.DeleteAutomatedBackups).To(Equal(false))
Expect(instance.CACertificateIdentifier).To(Equal("rds-ca-2019"))
Expand Down

0 comments on commit 8e0bdd9

Please sign in to comment.