Skip to content

Commit

Permalink
[rds]: Add missing selectors
Browse files Browse the repository at this point in the history
* Add `dbParameterGroupNameSelector` to ClusterInstance
* Add `parameterGroupNameSelector` to Instance

Signed-off-by: Yury Tsarev <[email protected]>
  • Loading branch information
ytsarev committed Jan 11, 2024
1 parent 279ae75 commit 029cdad
Show file tree
Hide file tree
Showing 13 changed files with 503 additions and 9 deletions.
18 changes: 18 additions & 0 deletions apis/rds/v1beta1/zz_clusterinstance_types.go

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

40 changes: 40 additions & 0 deletions apis/rds/v1beta1/zz_generated.deepcopy.go

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

64 changes: 64 additions & 0 deletions apis/rds/v1beta1/zz_generated.resolvers.go

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

18 changes: 18 additions & 0 deletions apis/rds/v1beta1/zz_instance_types.go

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

7 changes: 5 additions & 2 deletions config/rds/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ func Configure(p *config.Provider) {
RefFieldName: "SecurityGroupNameRefs",
SelectorFieldName: "SecurityGroupNameSelector",
}
r.References["parameter_group_name"] = config.Reference{
Type: "ParameterGroup",
r.References["db_parameter_group_name"] = config.Reference{
TerraformName: "aws_db_parameter_group",
}
r.References["db_subnet_group_name"] = config.Reference{
Type: "SubnetGroup",
Expand All @@ -98,6 +98,9 @@ func Configure(p *config.Provider) {
r.References["db_subnet_group_name"] = config.Reference{
Type: "SubnetGroup",
}
r.References["parameter_group_name"] = config.Reference{
TerraformName: "aws_db_parameter_group",
}
r.References["kms_key_id"] = config.Reference{
TerraformName: "aws_kms_key",
Extractor: common.PathARNExtractor,
Expand Down
4 changes: 3 additions & 1 deletion examples-generated/rds/dbsnapshotcopy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ spec:
instanceClass: db.t2.micro
maintenanceWindow: Fri:09:00-Fri:09:30
name: baz
parameterGroupName: default.mysql5.6
parameterGroupNameSelector:
matchLabels:
testing.upbound.io/example-name: example
passwordSecretRef:
key: example-key
name: example-secret
Expand Down
4 changes: 3 additions & 1 deletion examples-generated/rds/eventsubscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ spec:
engineVersion: 5.6.17
instanceClass: db.t2.micro
name: mydb
parameterGroupName: default.mysql5.6
parameterGroupNameSelector:
matchLabels:
testing.upbound.io/example-name: example
passwordSecretRef:
key: example-key
name: example-secret
Expand Down
4 changes: 3 additions & 1 deletion examples-generated/rds/instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ spec:
engine: mysql
engineVersion: "5.7"
instanceClass: db.t3.micro
parameterGroupName: default.mysql5.7
parameterGroupNameSelector:
matchLabels:
testing.upbound.io/example-name: example
passwordSecretRef:
key: example-key
name: example-secret
Expand Down
4 changes: 3 additions & 1 deletion examples-generated/rds/snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ spec:
instanceClass: db.t2.micro
maintenanceWindow: Fri:09:00-Fri:09:30
name: baz
parameterGroupName: default.mysql5.6
parameterGroupNameSelector:
matchLabels:
testing.upbound.io/example-name: example
passwordSecretRef:
key: example-key
name: example-secret
Expand Down
27 changes: 24 additions & 3 deletions examples/rds/clusterinstance.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
apiVersion: rds.aws.upbound.io/v1beta1
kind: ClusterInstance
metadata:
name: example
annotations:
upjet.upbound.io/manual-intervention: "This resource has a reference to Cluster, which needs manual intervention."
meta.upbound.io/example-id: rds/v1beta1/clusterinstance
name: example
spec:
forProvider:
region: us-west-1
identifier: example
clusterIdentifierRef:
name: example
engine: aurora-postgresql
instanceClass: db.r5.large
instanceClass: db.r5.large
dbParameterGroupNameSelector:
matchLabels:
testing.upbound.io/example-name: example-parametergroup-clusterinstance
---
apiVersion: rds.aws.upbound.io/v1beta1
kind: ParameterGroup
metadata:
annotations:
meta.upbound.io/example-id: rds/v1beta1/clusterinstance
labels:
testing.upbound.io/example-name: example-parametergroup-clusterinstance
name: example-parametergroup-clusterinstance
spec:
forProvider:
region: us-west-1
family: postgres12
description: example
parameter:
- name: application_name
value: "example"
applyMethod: immediate
22 changes: 22 additions & 0 deletions examples/rds/instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ spec:
kmsKeyIdSelector:
matchLabels:
testing.upbound.io/example-name: sample-key
parameterGroupNameSelector:
matchLabels:
testing.upbound.io/example-name: example-parametergroup-instance
writeConnectionSecretToRef:
name: example-dbinstance-out
namespace: default
Expand All @@ -50,3 +53,22 @@ spec:
region: us-west-1
description: Created with Crossplane
deletionWindowInDays: 7

---
apiVersion: rds.aws.upbound.io/v1beta1
kind: ParameterGroup
metadata:
annotations:
meta.upbound.io/example-id: rds/v1beta1/instance
labels:
testing.upbound.io/example-name: example-parametergroup-instance
name: example-parametergroup-instance
spec:
forProvider:
region: us-west-1
family: postgres12
description: example
parameter:
- name: application_name
value: "example"
applyMethod: immediate
Loading

0 comments on commit 029cdad

Please sign in to comment.