Skip to content

Commit ada76ca

Browse files
jaypipesa-hilaly
authored andcommitted
support overriding parameter values on param group
Adds code to allow a user to specify a set of parameter override values for a DB parameter group. The `Spec.ParameterOverrides` is a `map[string]*string` containing the parameter names and values for parameters in a DB parameter group that the user wishes to override from their defaults. The `Status.ParameterOverrideStatuses` field is a slice of `Parameter` structs that contains more "status-y" information about those overridden parameters. Still yet to work out is how I'm going to keep track of which parameters for which DB engine family can have ApplyMethod=intermediate and which ones must have ApplyMethod=pending-reboot. Signed-off-by: Jay Pipes <[email protected]>
1 parent 2107571 commit ada76ca

File tree

10 files changed

+419
-150
lines changed

10 files changed

+419
-150
lines changed

apis/v1alpha1/ack-generate-metadata.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ ack_generate_info:
33
build_hash: fe61d04673fd4d9848d5f726b01e0689a16d3733
44
go_version: go1.18.2
55
version: v0.19.3-1-gfe61d04
6-
api_directory_checksum: 6a967cc8a62d521d4f4816dbccc48f81d0cb271d
6+
api_directory_checksum: 420612ef2bc7cf0b19ebe41c44626560e060c4a1
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.27
99
generator_config_info:
10-
file_checksum: 48d8a87d42545d99ddabf9bea4ab180e08ab79b7
10+
file_checksum: 90a2d0d868a32e6474738ad70a557035f490780a
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/db_parameter_group.go

Lines changed: 5 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha1/generator.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,14 +322,27 @@ resources:
322322
fields:
323323
Name:
324324
is_primary_key: true
325-
Parameters:
326-
from:
327-
operation: ModifyDBParameterGroup
328-
path: Parameters
325+
# These are ONLY user-defined parameter overrides for the DB parameter
326+
# group. This does not contain default or system parameters.
327+
ParameterOverrides:
328+
custom_field:
329+
# The type is a map[string]string where the map keys are the
330+
# parameter name and the values are the parameter value. We
331+
# automatically determine the "apply method" for parameters so all
332+
# the user needs to do is specify the parameter name and value they
333+
# want to override...
334+
map_of: String
329335
Tags:
330336
compare:
331337
# We have a custom comparison function...
332338
is_ignored: true
339+
# These are the "statuses" for the user-defined parameter overrides in
340+
# Spec.ParameterOverrides
341+
ParameterOverrideStatuses:
342+
from:
343+
operation: DescribeDBParameters
344+
path: Parameters
345+
is_read_only: true
333346
DBSubnetGroup:
334347
renames:
335348
operations:

apis/v1alpha1/zz_generated.deepcopy.go

Lines changed: 23 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/rds.services.k8s.aws_dbparametergroups.yaml

Lines changed: 38 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -67,56 +67,10 @@ spec:
6767
character must be a letter \n * Can't end with a hyphen or contain
6868
two consecutive hyphens \n This value is stored as a lowercase string."
6969
type: string
70-
parameters:
71-
description: "An array of parameter names, values, and the application
72-
methods for the parameter update. At least one parameter name, value,
73-
and application method must be supplied; later arguments are optional.
74-
A maximum of 20 parameters can be modified in a single request.
75-
\n Valid Values (for the application method): immediate | pending-reboot
76-
\n You can use the immediate value with dynamic parameters only.
77-
You can use the pending-reboot value for both dynamic and static
78-
parameters. \n When the application method is immediate, changes
79-
to dynamic parameters are applied immediately to the DB instances
80-
associated with the parameter group. \n When the application method
81-
is pending-reboot, changes to dynamic and static parameters are
82-
applied after a reboot without failover to the DB instances associated
83-
with the parameter group. \n You can't use pending-reboot with dynamic
84-
parameters on RDS for SQL Server DB instances. Use immediate. \n
85-
For more information on modifying DB parameters, see Working with
86-
DB parameter groups (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithParamGroups.html)
87-
in the Amazon RDS User Guide."
88-
items:
89-
description: "This data type is used as a request parameter in the
90-
ModifyDBParameterGroup and ResetDBParameterGroup actions. \n This
91-
data type is used as a response element in the DescribeEngineDefaultParameters
92-
and DescribeDBParameters actions."
93-
properties:
94-
allowedValues:
95-
type: string
96-
applyMethod:
97-
type: string
98-
applyType:
99-
type: string
100-
dataType:
101-
type: string
102-
description:
103-
type: string
104-
isModifiable:
105-
type: boolean
106-
minimumEngineVersion:
107-
type: string
108-
parameterName:
109-
type: string
110-
parameterValue:
111-
type: string
112-
source:
113-
type: string
114-
supportedEngineModes:
115-
items:
116-
type: string
117-
type: array
118-
type: object
119-
type: array
70+
parameterOverrides:
71+
additionalProperties:
72+
type: string
73+
type: object
12074
tags:
12175
description: Tags to assign to the DB parameter group.
12276
items:
@@ -198,6 +152,40 @@ spec:
198152
- type
199153
type: object
200154
type: array
155+
parameterOverrideStatuses:
156+
description: A list of Parameter values.
157+
items:
158+
description: "This data type is used as a request parameter in the
159+
ModifyDBParameterGroup and ResetDBParameterGroup actions. \n This
160+
data type is used as a response element in the DescribeEngineDefaultParameters
161+
and DescribeDBParameters actions."
162+
properties:
163+
allowedValues:
164+
type: string
165+
applyMethod:
166+
type: string
167+
applyType:
168+
type: string
169+
dataType:
170+
type: string
171+
description:
172+
type: string
173+
isModifiable:
174+
type: boolean
175+
minimumEngineVersion:
176+
type: string
177+
parameterName:
178+
type: string
179+
parameterValue:
180+
type: string
181+
source:
182+
type: string
183+
supportedEngineModes:
184+
items:
185+
type: string
186+
type: array
187+
type: object
188+
type: array
201189
type: object
202190
type: object
203191
served: true

generator.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,14 +322,27 @@ resources:
322322
fields:
323323
Name:
324324
is_primary_key: true
325-
Parameters:
326-
from:
327-
operation: ModifyDBParameterGroup
328-
path: Parameters
325+
# These are ONLY user-defined parameter overrides for the DB parameter
326+
# group. This does not contain default or system parameters.
327+
ParameterOverrides:
328+
custom_field:
329+
# The type is a map[string]string where the map keys are the
330+
# parameter name and the values are the parameter value. We
331+
# automatically determine the "apply method" for parameters so all
332+
# the user needs to do is specify the parameter name and value they
333+
# want to override...
334+
map_of: String
329335
Tags:
330336
compare:
331337
# We have a custom comparison function...
332338
is_ignored: true
339+
# These are the "statuses" for the user-defined parameter overrides in
340+
# Spec.ParameterOverrides
341+
ParameterOverrideStatuses:
342+
from:
343+
operation: DescribeDBParameters
344+
path: Parameters
345+
is_read_only: true
333346
DBSubnetGroup:
334347
renames:
335348
operations:

helm/crds/rds.services.k8s.aws_dbparametergroups.yaml

Lines changed: 38 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -67,56 +67,10 @@ spec:
6767
character must be a letter \n * Can't end with a hyphen or contain
6868
two consecutive hyphens \n This value is stored as a lowercase string."
6969
type: string
70-
parameters:
71-
description: "An array of parameter names, values, and the application
72-
methods for the parameter update. At least one parameter name, value,
73-
and application method must be supplied; later arguments are optional.
74-
A maximum of 20 parameters can be modified in a single request.
75-
\n Valid Values (for the application method): immediate | pending-reboot
76-
\n You can use the immediate value with dynamic parameters only.
77-
You can use the pending-reboot value for both dynamic and static
78-
parameters. \n When the application method is immediate, changes
79-
to dynamic parameters are applied immediately to the DB instances
80-
associated with the parameter group. \n When the application method
81-
is pending-reboot, changes to dynamic and static parameters are
82-
applied after a reboot without failover to the DB instances associated
83-
with the parameter group. \n You can't use pending-reboot with dynamic
84-
parameters on RDS for SQL Server DB instances. Use immediate. \n
85-
For more information on modifying DB parameters, see Working with
86-
DB parameter groups (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithParamGroups.html)
87-
in the Amazon RDS User Guide."
88-
items:
89-
description: "This data type is used as a request parameter in the
90-
ModifyDBParameterGroup and ResetDBParameterGroup actions. \n This
91-
data type is used as a response element in the DescribeEngineDefaultParameters
92-
and DescribeDBParameters actions."
93-
properties:
94-
allowedValues:
95-
type: string
96-
applyMethod:
97-
type: string
98-
applyType:
99-
type: string
100-
dataType:
101-
type: string
102-
description:
103-
type: string
104-
isModifiable:
105-
type: boolean
106-
minimumEngineVersion:
107-
type: string
108-
parameterName:
109-
type: string
110-
parameterValue:
111-
type: string
112-
source:
113-
type: string
114-
supportedEngineModes:
115-
items:
116-
type: string
117-
type: array
118-
type: object
119-
type: array
70+
parameterOverrides:
71+
additionalProperties:
72+
type: string
73+
type: object
12074
tags:
12175
description: Tags to assign to the DB parameter group.
12276
items:
@@ -198,6 +152,40 @@ spec:
198152
- type
199153
type: object
200154
type: array
155+
parameterOverrideStatuses:
156+
description: A list of Parameter values.
157+
items:
158+
description: "This data type is used as a request parameter in the
159+
ModifyDBParameterGroup and ResetDBParameterGroup actions. \n This
160+
data type is used as a response element in the DescribeEngineDefaultParameters
161+
and DescribeDBParameters actions."
162+
properties:
163+
allowedValues:
164+
type: string
165+
applyMethod:
166+
type: string
167+
applyType:
168+
type: string
169+
dataType:
170+
type: string
171+
description:
172+
type: string
173+
isModifiable:
174+
type: boolean
175+
minimumEngineVersion:
176+
type: string
177+
parameterName:
178+
type: string
179+
parameterValue:
180+
type: string
181+
source:
182+
type: string
183+
supportedEngineModes:
184+
items:
185+
type: string
186+
type: array
187+
type: object
188+
type: array
201189
type: object
202190
type: object
203191
served: true

pkg/resource/db_parameter_group/delta.go

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)