Skip to content

Commit

Permalink
Merge pull request #1083 from ytsarev/rds-add-selectors
Browse files Browse the repository at this point in the history
[rds]: Add `dbParameterGroupNameSelector` to `ClusterInstance`
  • Loading branch information
ytsarev authored Jan 16, 2024
2 parents 4819dcf + b3d6ac1 commit b4bbf97
Show file tree
Hide file tree
Showing 6 changed files with 245 additions and 2 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.

20 changes: 20 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.

32 changes: 32 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.

4 changes: 2 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 Down
23 changes: 23 additions & 0 deletions examples/rds/clusterinstance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ 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 Down Expand Up @@ -49,3 +52,23 @@ metadata:
type: Opaque
stringData:
password: TestPass0!

---

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-ci
name: example-parametergroup-ci
spec:
forProvider:
region: us-west-1
family: aurora-postgresql15
description: example
parameter:
- name: application_name
value: "example"
applyMethod: immediate
150 changes: 150 additions & 0 deletions package/crds/rds.aws.upbound.io_clusterinstances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,81 @@ spec:
description: Name of the DB parameter group to associate with
this instance.
type: string
dbParameterGroupNameRef:
description: Reference to a ParameterGroup in rds to populate
dbParameterGroupName.
properties:
name:
description: Name of the referenced object.
type: string
policy:
description: Policies for referencing.
properties:
resolution:
default: Required
description: Resolution specifies whether resolution of
this reference is required. The default is 'Required',
which means the reconcile will fail if the reference
cannot be resolved. 'Optional' means this reference
will be a no-op if it cannot be resolved.
enum:
- Required
- Optional
type: string
resolve:
description: Resolve specifies when this reference should
be resolved. The default is 'IfNotPresent', which will
attempt to resolve the reference only when the corresponding
field is not present. Use 'Always' to resolve the reference
on every reconcile.
enum:
- Always
- IfNotPresent
type: string
type: object
required:
- name
type: object
dbParameterGroupNameSelector:
description: Selector for a ParameterGroup in rds to populate
dbParameterGroupName.
properties:
matchControllerRef:
description: MatchControllerRef ensures an object with the
same controller reference as the selecting object is selected.
type: boolean
matchLabels:
additionalProperties:
type: string
description: MatchLabels ensures an object with matching labels
is selected.
type: object
policy:
description: Policies for selection.
properties:
resolution:
default: Required
description: Resolution specifies whether resolution of
this reference is required. The default is 'Required',
which means the reconcile will fail if the reference
cannot be resolved. 'Optional' means this reference
will be a no-op if it cannot be resolved.
enum:
- Required
- Optional
type: string
resolve:
description: Resolve specifies when this reference should
be resolved. The default is 'IfNotPresent', which will
attempt to resolve the reference only when the corresponding
field is not present. Use 'Always' to resolve the reference
on every reconcile.
enum:
- Always
- IfNotPresent
type: string
type: object
type: object
dbSubnetGroupName:
description: 'DB subnet group to associate with this DB instance.
NOTE: This must match the db_subnet_group_name of the attached
Expand Down Expand Up @@ -588,6 +663,81 @@ spec:
description: Name of the DB parameter group to associate with
this instance.
type: string
dbParameterGroupNameRef:
description: Reference to a ParameterGroup in rds to populate
dbParameterGroupName.
properties:
name:
description: Name of the referenced object.
type: string
policy:
description: Policies for referencing.
properties:
resolution:
default: Required
description: Resolution specifies whether resolution of
this reference is required. The default is 'Required',
which means the reconcile will fail if the reference
cannot be resolved. 'Optional' means this reference
will be a no-op if it cannot be resolved.
enum:
- Required
- Optional
type: string
resolve:
description: Resolve specifies when this reference should
be resolved. The default is 'IfNotPresent', which will
attempt to resolve the reference only when the corresponding
field is not present. Use 'Always' to resolve the reference
on every reconcile.
enum:
- Always
- IfNotPresent
type: string
type: object
required:
- name
type: object
dbParameterGroupNameSelector:
description: Selector for a ParameterGroup in rds to populate
dbParameterGroupName.
properties:
matchControllerRef:
description: MatchControllerRef ensures an object with the
same controller reference as the selecting object is selected.
type: boolean
matchLabels:
additionalProperties:
type: string
description: MatchLabels ensures an object with matching labels
is selected.
type: object
policy:
description: Policies for selection.
properties:
resolution:
default: Required
description: Resolution specifies whether resolution of
this reference is required. The default is 'Required',
which means the reconcile will fail if the reference
cannot be resolved. 'Optional' means this reference
will be a no-op if it cannot be resolved.
enum:
- Required
- Optional
type: string
resolve:
description: Resolve specifies when this reference should
be resolved. The default is 'IfNotPresent', which will
attempt to resolve the reference only when the corresponding
field is not present. Use 'Always' to resolve the reference
on every reconcile.
enum:
- Always
- IfNotPresent
type: string
type: object
type: object
dbSubnetGroupName:
description: 'DB subnet group to associate with this DB instance.
NOTE: This must match the db_subnet_group_name of the attached
Expand Down

0 comments on commit b4bbf97

Please sign in to comment.