From a09e1e07a73d0c7ccb60593053e0d9ca0e88aed3 Mon Sep 17 00:00:00 2001 From: Yury Tsarev Date: Fri, 19 Apr 2024 14:56:30 +0200 Subject: [PATCH] [Cluster.RDS] Add `ClusterParameterGroup` and `ParameterGroup` Selectors * Add `dbClusterParameterGroupNameSelector` * Add `dbInstanceParameterGroupNameSelector` * Extend uptest example * Include UP_VERSION updated to be able to build on recent docker versions Signed-off-by: Yury Tsarev --- Makefile | 2 +- apis/rds/v1beta1/zz_cluster_types.go | 36 +++ apis/rds/v1beta1/zz_generated.deepcopy.go | 40 +++ apis/rds/v1beta1/zz_generated.resolvers.go | 76 +++++ config/rds/config.go | 6 + examples/rds/v1beta1/cluster.yaml | 46 +++ package/crds/rds.aws.upbound.io_clusters.yaml | 304 ++++++++++++++++++ 7 files changed, 509 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6f48e7604a..352eb6411e 100644 --- a/Makefile +++ b/Makefile @@ -77,7 +77,7 @@ export SUBPACKAGES := $(SUBPACKAGES) # Setup Kubernetes tools KIND_VERSION = v0.21.0 -UP_VERSION = v0.20.0 +UP_VERSION = v0.28.0 UP_CHANNEL = stable UPTEST_VERSION = v0.11.1 KUSTOMIZE_VERSION = v5.3.0 diff --git a/apis/rds/v1beta1/zz_cluster_types.go b/apis/rds/v1beta1/zz_cluster_types.go index c8d56866f9..c56e35a898 100755 --- a/apis/rds/v1beta1/zz_cluster_types.go +++ b/apis/rds/v1beta1/zz_cluster_types.go @@ -47,11 +47,29 @@ type ClusterInitParameters struct { DBClusterInstanceClass *string `json:"dbClusterInstanceClass,omitempty" tf:"db_cluster_instance_class,omitempty"` // A cluster parameter group to associate with the cluster. + // +crossplane:generate:reference:type=github.com/upbound/provider-aws/apis/rds/v1beta1.ClusterParameterGroup DBClusterParameterGroupName *string `json:"dbClusterParameterGroupName,omitempty" tf:"db_cluster_parameter_group_name,omitempty"` + // Reference to a ClusterParameterGroup in rds to populate dbClusterParameterGroupName. + // +kubebuilder:validation:Optional + DBClusterParameterGroupNameRef *v1.Reference `json:"dbClusterParameterGroupNameRef,omitempty" tf:"-"` + + // Selector for a ClusterParameterGroup in rds to populate dbClusterParameterGroupName. + // +kubebuilder:validation:Optional + DBClusterParameterGroupNameSelector *v1.Selector `json:"dbClusterParameterGroupNameSelector,omitempty" tf:"-"` + // Instance parameter group to associate with all instances of the DB cluster. The db_instance_parameter_group_name parameter is only valid in combination with the allow_major_version_upgrade parameter. + // +crossplane:generate:reference:type=github.com/upbound/provider-aws/apis/rds/v1beta1.ParameterGroup DBInstanceParameterGroupName *string `json:"dbInstanceParameterGroupName,omitempty" tf:"db_instance_parameter_group_name,omitempty"` + // Reference to a ParameterGroup in rds to populate dbInstanceParameterGroupName. + // +kubebuilder:validation:Optional + DBInstanceParameterGroupNameRef *v1.Reference `json:"dbInstanceParameterGroupNameRef,omitempty" tf:"-"` + + // Selector for a ParameterGroup in rds to populate dbInstanceParameterGroupName. + // +kubebuilder:validation:Optional + DBInstanceParameterGroupNameSelector *v1.Selector `json:"dbInstanceParameterGroupNameSelector,omitempty" tf:"-"` + // DB subnet group to associate with this DB cluster. // NOTE: This must match the db_subnet_group_name specified on every aws_rds_cluster_instance in the cluster. // +crossplane:generate:reference:type=SubnetGroup @@ -453,13 +471,31 @@ type ClusterParameters struct { DBClusterInstanceClass *string `json:"dbClusterInstanceClass,omitempty" tf:"db_cluster_instance_class,omitempty"` // A cluster parameter group to associate with the cluster. + // +crossplane:generate:reference:type=github.com/upbound/provider-aws/apis/rds/v1beta1.ClusterParameterGroup // +kubebuilder:validation:Optional DBClusterParameterGroupName *string `json:"dbClusterParameterGroupName,omitempty" tf:"db_cluster_parameter_group_name,omitempty"` + // Reference to a ClusterParameterGroup in rds to populate dbClusterParameterGroupName. + // +kubebuilder:validation:Optional + DBClusterParameterGroupNameRef *v1.Reference `json:"dbClusterParameterGroupNameRef,omitempty" tf:"-"` + + // Selector for a ClusterParameterGroup in rds to populate dbClusterParameterGroupName. + // +kubebuilder:validation:Optional + DBClusterParameterGroupNameSelector *v1.Selector `json:"dbClusterParameterGroupNameSelector,omitempty" tf:"-"` + // Instance parameter group to associate with all instances of the DB cluster. The db_instance_parameter_group_name parameter is only valid in combination with the allow_major_version_upgrade parameter. + // +crossplane:generate:reference:type=github.com/upbound/provider-aws/apis/rds/v1beta1.ParameterGroup // +kubebuilder:validation:Optional DBInstanceParameterGroupName *string `json:"dbInstanceParameterGroupName,omitempty" tf:"db_instance_parameter_group_name,omitempty"` + // Reference to a ParameterGroup in rds to populate dbInstanceParameterGroupName. + // +kubebuilder:validation:Optional + DBInstanceParameterGroupNameRef *v1.Reference `json:"dbInstanceParameterGroupNameRef,omitempty" tf:"-"` + + // Selector for a ParameterGroup in rds to populate dbInstanceParameterGroupName. + // +kubebuilder:validation:Optional + DBInstanceParameterGroupNameSelector *v1.Selector `json:"dbInstanceParameterGroupNameSelector,omitempty" tf:"-"` + // DB subnet group to associate with this DB cluster. // NOTE: This must match the db_subnet_group_name specified on every aws_rds_cluster_instance in the cluster. // +crossplane:generate:reference:type=SubnetGroup diff --git a/apis/rds/v1beta1/zz_generated.deepcopy.go b/apis/rds/v1beta1/zz_generated.deepcopy.go index 72b3c5a14f..d0e3f39721 100644 --- a/apis/rds/v1beta1/zz_generated.deepcopy.go +++ b/apis/rds/v1beta1/zz_generated.deepcopy.go @@ -913,11 +913,31 @@ func (in *ClusterInitParameters) DeepCopyInto(out *ClusterInitParameters) { *out = new(string) **out = **in } + if in.DBClusterParameterGroupNameRef != nil { + in, out := &in.DBClusterParameterGroupNameRef, &out.DBClusterParameterGroupNameRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.DBClusterParameterGroupNameSelector != nil { + in, out := &in.DBClusterParameterGroupNameSelector, &out.DBClusterParameterGroupNameSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.DBInstanceParameterGroupName != nil { in, out := &in.DBInstanceParameterGroupName, &out.DBInstanceParameterGroupName *out = new(string) **out = **in } + if in.DBInstanceParameterGroupNameRef != nil { + in, out := &in.DBInstanceParameterGroupNameRef, &out.DBInstanceParameterGroupNameRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.DBInstanceParameterGroupNameSelector != nil { + in, out := &in.DBInstanceParameterGroupNameSelector, &out.DBInstanceParameterGroupNameSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.DBSubnetGroupName != nil { in, out := &in.DBSubnetGroupName, &out.DBSubnetGroupName *out = new(string) @@ -2729,11 +2749,31 @@ func (in *ClusterParameters) DeepCopyInto(out *ClusterParameters) { *out = new(string) **out = **in } + if in.DBClusterParameterGroupNameRef != nil { + in, out := &in.DBClusterParameterGroupNameRef, &out.DBClusterParameterGroupNameRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.DBClusterParameterGroupNameSelector != nil { + in, out := &in.DBClusterParameterGroupNameSelector, &out.DBClusterParameterGroupNameSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.DBInstanceParameterGroupName != nil { in, out := &in.DBInstanceParameterGroupName, &out.DBInstanceParameterGroupName *out = new(string) **out = **in } + if in.DBInstanceParameterGroupNameRef != nil { + in, out := &in.DBInstanceParameterGroupNameRef, &out.DBInstanceParameterGroupNameRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.DBInstanceParameterGroupNameSelector != nil { + in, out := &in.DBInstanceParameterGroupNameSelector, &out.DBInstanceParameterGroupNameSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.DBSubnetGroupName != nil { in, out := &in.DBSubnetGroupName, &out.DBSubnetGroupName *out = new(string) diff --git a/apis/rds/v1beta1/zz_generated.resolvers.go b/apis/rds/v1beta1/zz_generated.resolvers.go index 4bbcc833ee..d82a73bc49 100644 --- a/apis/rds/v1beta1/zz_generated.resolvers.go +++ b/apis/rds/v1beta1/zz_generated.resolvers.go @@ -28,6 +28,44 @@ func (mg *Cluster) ResolveReferences(ctx context.Context, c client.Reader) error var rsp reference.ResolutionResponse var mrsp reference.MultiResolutionResponse var err error + { + m, l, err = apisresolver.GetManagedResource("rds.aws.upbound.io", "v1beta1", "ClusterParameterGroup", "ClusterParameterGroupList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.DBClusterParameterGroupName), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.DBClusterParameterGroupNameRef, + Selector: mg.Spec.ForProvider.DBClusterParameterGroupNameSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.DBClusterParameterGroupName") + } + mg.Spec.ForProvider.DBClusterParameterGroupName = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.DBClusterParameterGroupNameRef = rsp.ResolvedReference + { + m, l, err = apisresolver.GetManagedResource("rds.aws.upbound.io", "v1beta1", "ParameterGroup", "ParameterGroupList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.DBInstanceParameterGroupName), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.DBInstanceParameterGroupNameRef, + Selector: mg.Spec.ForProvider.DBInstanceParameterGroupNameSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.DBInstanceParameterGroupName") + } + mg.Spec.ForProvider.DBInstanceParameterGroupName = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.DBInstanceParameterGroupNameRef = rsp.ResolvedReference { m, l, err = apisresolver.GetManagedResource("rds.aws.upbound.io", "v1beta1", "SubnetGroup", "SubnetGroupList") if err != nil { @@ -146,6 +184,44 @@ func (mg *Cluster) ResolveReferences(ctx context.Context, c client.Reader) error } mg.Spec.ForProvider.VPCSecurityGroupIds = reference.ToPtrValues(mrsp.ResolvedValues) mg.Spec.ForProvider.VPCSecurityGroupIDRefs = mrsp.ResolvedReferences + { + m, l, err = apisresolver.GetManagedResource("rds.aws.upbound.io", "v1beta1", "ClusterParameterGroup", "ClusterParameterGroupList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.DBClusterParameterGroupName), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.DBClusterParameterGroupNameRef, + Selector: mg.Spec.InitProvider.DBClusterParameterGroupNameSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.DBClusterParameterGroupName") + } + mg.Spec.InitProvider.DBClusterParameterGroupName = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.DBClusterParameterGroupNameRef = rsp.ResolvedReference + { + m, l, err = apisresolver.GetManagedResource("rds.aws.upbound.io", "v1beta1", "ParameterGroup", "ParameterGroupList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.DBInstanceParameterGroupName), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.DBInstanceParameterGroupNameRef, + Selector: mg.Spec.InitProvider.DBInstanceParameterGroupNameSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.DBInstanceParameterGroupName") + } + mg.Spec.InitProvider.DBInstanceParameterGroupName = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.DBInstanceParameterGroupNameRef = rsp.ResolvedReference { m, l, err = apisresolver.GetManagedResource("rds.aws.upbound.io", "v1beta1", "SubnetGroup", "SubnetGroupList") if err != nil { diff --git a/config/rds/config.go b/config/rds/config.go index 6e5c6e98d5..00d725a9a1 100644 --- a/config/rds/config.go +++ b/config/rds/config.go @@ -29,6 +29,12 @@ func Configure(p *config.Provider) { r.References["db_subnet_group_name"] = config.Reference{ Type: "SubnetGroup", } + r.References["db_cluster_parameter_group_name"] = config.Reference{ + TerraformName: "aws_rds_cluster_parameter_group", + } + r.References["db_instance_parameter_group_name"] = config.Reference{ + TerraformName: "aws_db_parameter_group", + } r.UseAsync = true r.Sensitive.AdditionalConnectionDetailsFn = func(attr map[string]any) (map[string][]byte, error) { conn := map[string][]byte{} diff --git a/examples/rds/v1beta1/cluster.yaml b/examples/rds/v1beta1/cluster.yaml index fa7307457e..a26f8b1fab 100644 --- a/examples/rds/v1beta1/cluster.yaml +++ b/examples/rds/v1beta1/cluster.yaml @@ -19,6 +19,52 @@ spec: namespace: upbound-system key: password skipFinalSnapshot: true + dbClusterParameterGroupNameSelector: + matchLabels: + testing.upbound.io/example-name: example-ci-cluster + dbInstanceParameterGroupNameSelector: + matchLabels: + testing.upbound.io/example-name: example-ci-cluster-instance writeConnectionSecretToRef: name: sample-rds-cluster-secret namespace: upbound-system + +--- + +apiVersion: rds.aws.upbound.io/v1beta1 +kind: ClusterParameterGroup +metadata: + annotations: + meta.upbound.io/example-id: rds/v1beta1/cluster + labels: + testing.upbound.io/example-name: example-ci-cluster + name: example-ci-cluster +spec: + forProvider: + region: us-west-1 + description: RDS custom cluster parameter group + family: aurora-postgresql15 + parameter: + - name: application_name + value: "example-rds-cluster" + applyMethod: immediate + +--- + +apiVersion: rds.aws.upbound.io/v1beta1 +kind: ParameterGroup +metadata: + annotations: + meta.upbound.io/example-id: rds/v1beta1/cluster + labels: + testing.upbound.io/example-name: example-ci-cluster-instance + name: example-parametergroup-ci-cluster-instance +spec: + forProvider: + region: us-west-1 + family: aurora-postgresql15 + description: example + parameter: + - name: application_name + value: "example-cluster-instance" + applyMethod: immediate diff --git a/package/crds/rds.aws.upbound.io_clusters.yaml b/package/crds/rds.aws.upbound.io_clusters.yaml index 3712c64f5c..8aadf21be6 100644 --- a/package/crds/rds.aws.upbound.io_clusters.yaml +++ b/package/crds/rds.aws.upbound.io_clusters.yaml @@ -135,12 +135,164 @@ spec: dbClusterParameterGroupName: description: A cluster parameter group to associate with the cluster. type: string + dbClusterParameterGroupNameRef: + description: Reference to a ClusterParameterGroup in rds 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 rds 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 dbInstanceParameterGroupName: description: Instance parameter group to associate with all instances of the DB cluster. The db_instance_parameter_group_name parameter is only valid in combination with the allow_major_version_upgrade parameter. type: string + dbInstanceParameterGroupNameRef: + description: Reference to a ParameterGroup in rds to populate + dbInstanceParameterGroupName. + 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 + dbInstanceParameterGroupNameSelector: + description: Selector for a ParameterGroup in rds to populate + dbInstanceParameterGroupName. + 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 cluster. @@ -967,12 +1119,164 @@ spec: dbClusterParameterGroupName: description: A cluster parameter group to associate with the cluster. type: string + dbClusterParameterGroupNameRef: + description: Reference to a ClusterParameterGroup in rds 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 rds 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 dbInstanceParameterGroupName: description: Instance parameter group to associate with all instances of the DB cluster. The db_instance_parameter_group_name parameter is only valid in combination with the allow_major_version_upgrade parameter. type: string + dbInstanceParameterGroupNameRef: + description: Reference to a ParameterGroup in rds to populate + dbInstanceParameterGroupName. + 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 + dbInstanceParameterGroupNameSelector: + description: Selector for a ParameterGroup in rds to populate + dbInstanceParameterGroupName. + 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 cluster.