Skip to content

Commit

Permalink
DocDB: Add reference configuration of Cluster to dbClusterParameterGr…
Browse files Browse the repository at this point in the history
…oupName

* config and generated files
* associated uptest example extension

Signed-off-by: Yury Tsarev <[email protected]>
(cherry picked from commit 6993dfd)
  • Loading branch information
ytsarev authored and turkenf committed Feb 15, 2024
1 parent 384bfc6 commit bed29b8
Show file tree
Hide file tree
Showing 6 changed files with 245 additions and 0 deletions.
18 changes: 18 additions & 0 deletions apis/docdb/v1beta1/zz_cluster_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/docdb/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/docdb/v1beta1/zz_generated.resolvers.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/docdb/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ func Configure(p *config.Provider) {
}
return conn, nil
}
r.References["db_cluster_parameter_group_name"] = config.Reference{
TerraformName: "aws_docdb_cluster_parameter_group",
}
})

p.AddResourceConfigurator("aws_docdb_cluster_instance", func(r *config.Resource) {
Expand Down
22 changes: 22 additions & 0 deletions examples/docdb/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ spec:
masterUsername: foo
preferredBackupWindow: 07:00-09:00
skipFinalSnapshot: true
dbClusterParameterGroupNameSelector:
matchLabels:
testing.upbound.io/example-name: docdb-cluster-test

---

Expand All @@ -33,3 +36,22 @@ metadata:
type: Opaque
stringData:
password: "Upboundtest!"

---

apiVersion: docdb.aws.upbound.io/v1beta1
kind: ClusterParameterGroup
metadata:
annotations:
meta.upbound.io/example-id: docdb/v1beta1/cluster
labels:
testing.upbound.io/example-name: docdb-cluster-test
name: example
spec:
forProvider:
description: docdb cluster parameter group
family: docdb5.0
parameter:
- name: tls
value: enabled
region: us-west-2
150 changes: 150 additions & 0 deletions package/crds/docdb.aws.upbound.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,81 @@ spec:
dbClusterParameterGroupName:
description: A cluster parameter group to associate with the cluster.
type: string
dbClusterParameterGroupNameRef:
description: Reference to a ClusterParameterGroup in docdb to
populate dbClusterParameterGroupName.
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
dbClusterParameterGroupNameSelector:
description: Selector for a ClusterParameterGroup in docdb to
populate dbClusterParameterGroupName.
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: A DB subnet group to associate with this DB instance.
type: string
Expand Down Expand Up @@ -371,6 +446,81 @@ spec:
dbClusterParameterGroupName:
description: A cluster parameter group to associate with the cluster.
type: string
dbClusterParameterGroupNameRef:
description: Reference to a ClusterParameterGroup in docdb to
populate dbClusterParameterGroupName.
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
dbClusterParameterGroupNameSelector:
description: Selector for a ClusterParameterGroup in docdb to
populate dbClusterParameterGroupName.
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: A DB subnet group to associate with this DB instance.
type: string
Expand Down

0 comments on commit bed29b8

Please sign in to comment.