diff --git a/apis/rds/v1beta1/zz_clusterinstance_terraformed.go b/apis/rds/v1beta1/zz_clusterinstance_terraformed.go index 9439a70fd0..ca6f546759 100755 --- a/apis/rds/v1beta1/zz_clusterinstance_terraformed.go +++ b/apis/rds/v1beta1/zz_clusterinstance_terraformed.go @@ -118,6 +118,9 @@ func (tr *ClusterInstance) LateInitialize(attrs []byte) (bool, error) { return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") } opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + opts = append(opts, resource.WithNameFilter("DBParameterGroupName")) + opts = append(opts, resource.WithNameFilter("EngineVersion")) + opts = append(opts, resource.WithNameFilter("PreferredBackupWindow")) li := resource.NewGenericLateInitializer(opts...) return li.LateInitialize(&tr.Spec.ForProvider, params) diff --git a/config/rds/config.go b/config/rds/config.go index 11d1751ebc..03927b2094 100644 --- a/config/rds/config.go +++ b/config/rds/config.go @@ -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{ diff --git a/examples/rds/v1beta1/clusterinstance.yaml b/examples/rds/v1beta1/clusterinstance.yaml index 9bd0629e80..937d6b5836 100644 --- a/examples/rds/v1beta1/clusterinstance.yaml +++ b/examples/rds/v1beta1/clusterinstance.yaml @@ -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 --- @@ -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 @@ -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"