Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature for RDS DB Parametergroups #577

Closed

Conversation

Dkaykay
Copy link
Contributor

@Dkaykay Dkaykay commented Mar 5, 2021

Description of your changes

Add rds/dbparametergroup resources as described in
#567
by following the guidelines in https://github.com/crossplane/provider-aws/blob/master/CODE_GENERATION.md

ToDo:
Add the possibility to pass in json / parameters that will be added/changed in the created DB parametergroup. It seems like these parameters cant be passed in at creation of the parametergroup. They need to be changed after it is created:
https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBParameterGroup.html

@Dkaykay Dkaykay force-pushed the feature/rds-dbparametergroup branch from a110739 to 8b8ae85 Compare March 5, 2021 08:42
Signed-off-by: Denis Holschuh <[email protected]>
@Dkaykay Dkaykay force-pushed the feature/rds-dbparametergroup branch from e90dbb5 to 4de48df Compare March 5, 2021 09:08
@muvaf muvaf self-assigned this Mar 8, 2021
Copy link
Member

@muvaf muvaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Dkaykay ! That's a pretty good start!

pkg/controller/rds/dbparametergroup/setup.go Outdated Show resolved Hide resolved
//
// This value is stored as a lowercase string.
// +kubebuilder:validation:Required
DBParameterGroupName *string `json:"dbParameterGroupName"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using external name annotation for this field, so we should ignore it in generator-config.yaml like this. It needs to be ignored in all AWS calls in zz_controller.go, i.e. CreateDBParameterGroupInput.DBParameterGroupName etc.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to re-run the code generator so that this field is removed.

@Dkaykay Dkaykay marked this pull request as ready for review March 10, 2021 15:07
@Dkaykay Dkaykay requested a review from muvaf March 12, 2021 09:03
@Dkaykay Dkaykay changed the title feature/rds-dbparametergroup Add feature for RDS DB Parametergroups Mar 12, 2021
@Dkaykay
Copy link
Contributor Author

Dkaykay commented Mar 15, 2021

@muvaf can you review, please? Implemented & tested basic functionalities for creating, updating and deleting RDS DB Parametergroups

Copy link
Member

@muvaf muvaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few small things but I think it's pretty close to merge. Thanks a lot @Dkaykay !

apis/rds/v1alpha1/generator-config.yaml Show resolved Hide resolved
examples/rds/dbparametergroup.yaml Outdated Show resolved Hide resolved
pkg/controller/rds/dbparametergroup/setup.go Outdated Show resolved Hide resolved
pkg/controller/rds/dbparametergroup/setup.go Outdated Show resolved Hide resolved
apis/rds/v1alpha1/custom_types.go Outdated Show resolved Hide resolved
pkg/controller/rds/dbparametergroup/setup.go Outdated Show resolved Hide resolved
pkg/controller/rds/dbparametergroup/setup.go Outdated Show resolved Hide resolved
pkg/controller/rds/dbparametergroup/setup.go Outdated Show resolved Hide resolved
pkg/controller/rds/dbparametergroup/setup.go Outdated Show resolved Hide resolved
pkg/controller/rds/dbparametergroup/setup.go Show resolved Hide resolved
@Dkaykay Dkaykay requested a review from muvaf April 9, 2021 06:52
Copy link
Member

@muvaf muvaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! A few things:

  • ACK needs to run again to remove the DBParameterGroupName from CRD.
  • make reviewable should work.
  • Could you squash the commits?
  • Lastly, can you confirm given example YAML works? create, update, delete scenarios.

//
// This value is stored as a lowercase string.
// +kubebuilder:validation:Required
DBParameterGroupName *string `json:"dbParameterGroupName"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to re-run the code generator so that this field is removed.

spec:
forProvider:
region: eu-central-1
dbParameterGroupName: example-dbparametergroup
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dbParameterGroupName: example-dbparametergroup

Copy link
Contributor Author

@Dkaykay Dkaykay Apr 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added to generator-config.yaml:
- CreateDBParameterGroupInput.DBParameterGroupName
- DeleteDBParameterGroupInput.DBParameterGroupName
- ModifyDBParameterGroupInput.DBParameterGroupName
- DescribeDBParameterGroupInput.DBParameterGroupName

But the field is not getting removed when running the generator. What am i missing here @muvaf ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, it seems that i am not authorized to squash & merge due to the branch being protected.

make reviewable test was green as well as create, update and delete scenarios.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can squash your commits locally and then git push --force because you’re pushing to your own fork

examples/rds/dbparametergroup.yaml Outdated Show resolved Hide resolved
pkg/controller/rds/dbparametergroup/setup.go Outdated Show resolved Hide resolved
dholeshu and others added 15 commits April 12, 2021 13:22
Signed-off-by: Dkaykay <[email protected]>
Signed-off-by: Dkaykay <[email protected]>

fix: remove DBParameterGroupName

chore: make example more generic
@Dkaykay Dkaykay closed this Apr 14, 2021
@Dkaykay Dkaykay reopened this Apr 14, 2021
@Dkaykay
Copy link
Contributor Author

Dkaykay commented Apr 14, 2021

closing PR and re-creating from non-broken branch

@Dkaykay Dkaykay closed this Apr 14, 2021
tektondeploy pushed a commit to gtn3010/provider-aws that referenced this pull request Mar 12, 2024
…4.56.0

Bump Terraform provider version to v4.56.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants