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

Commit

Permalink
Merge pull request #1183 from alphagov/lock-rds-engine-version
Browse files Browse the repository at this point in the history
Lock the engine version of RDS aurora-postgres
  • Loading branch information
blairboy362 authored Sep 9, 2020
2 parents 0419eed + 8e0bdd9 commit 4e34afb
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 4e34afb

Please sign in to comment.