Skip to content

Commit

Permalink
Merge pull request #1326 from haarchri/fix/rds-clusterinstance
Browse files Browse the repository at this point in the history
fix(rds): fix late init for rds clusterinstance
  • Loading branch information
turkenf authored May 24, 2024
2 parents 9c3df41 + 5570fe4 commit 5df2fd2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
3 changes: 3 additions & 0 deletions apis/rds/v1beta1/zz_clusterinstance_terraformed.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions config/rds/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ func Configure(p *config.Provider) {
delete(r.References, "engine")
delete(r.References, "engine_version")
r.UseAsync = true
r.LateInitializer = config.LateInitializer{
IgnoredFields: []string{"engine_version", "db_parameter_group_name", "preferred_backup_window"},
}
})
p.AddResourceConfigurator("aws_db_instance", func(r *config.Resource) {
r.References["db_subnet_group_name"] = config.Reference{
Expand Down
19 changes: 10 additions & 9 deletions examples/rds/v1beta1/clusterinstance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ spec:
testing.upbound.io/example-name: example-ci
engine: aurora-postgresql
instanceClass: db.r5.large
dbParameterGroupNameSelector:
matchLabels:
testing.upbound.io/example-name: example-ci

---

Expand All @@ -36,6 +33,11 @@ spec:
forProvider:
region: us-west-1
engine: aurora-postgresql
engineVersion: "15.6"
dbClusterParameterGroupNameSelector:
matchLabels:
testing.upbound.io/example-name: example-ci
preferredBackupWindow: "04:00-05:00"
masterUsername: cpadmin
masterPasswordSecretRef:
name: sample-cluster-password
Expand All @@ -60,19 +62,18 @@ stringData:
---

apiVersion: rds.aws.upbound.io/v1beta1
kind: ParameterGroup
kind: ClusterParameterGroup
metadata:
annotations:
meta.upbound.io/example-id: rds/v1beta1/clusterinstance
labels:
testing.upbound.io/example-name: example-ci
name: example-parametergroup-ci
name: example-clusterparametergroup-ci
spec:
forProvider:
region: us-west-1
description: RDS default cluster parameter group
family: aurora-postgresql15
description: example
parameter:
- name: application_name
value: "example"
applyMethod: immediate
- name: apg_plan_mgmt.capture_plan_baselines
value: "manual"

0 comments on commit 5df2fd2

Please sign in to comment.