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

Terratest AWS module for RDS has issue with GetParameterValueForParameterOfRdsInstance function #675

Closed
smeyer53027 opened this issue Oct 8, 2020 · 3 comments · Fixed by #1498
Labels
bug Something isn't working

Comments

@smeyer53027
Copy link

Bug report: github.com/gruntwork-io/terratest/modules/aws/rds.go has issue with GetParameterValueForParameterOfRdsInstance function and it's dependent function GetParameterValueForParameterOfRdsInstanceE. The process loads all the parameters from the parameter group for the specified RDS instance and tries to locate the specified parameter in the set, but in fact, it is not loading all parameters. The dependent AWS API call DescribeDBParameters, by default, only returns the first 100 parameters (in alphabetical order) and if your parameter group has more than 100 parameters and the parameter you are looking for is not in the first 100, the function throw errors, incorrectly reporting the parameter does not exist.

Recommend the functions support pagination using the Marker parameter to scan all the parameters, 100 at a time.

@brikis98 brikis98 added bug Something isn't working help wanted labels Oct 9, 2020
@brikis98
Copy link
Member

brikis98 commented Oct 9, 2020

Thanks for reporting! Would you be up for a PR to fix this?

@brikis98 brikis98 self-assigned this Oct 9, 2020
@smeyer53027
Copy link
Author

I have modified the related modules to make this work but it's a bit messy. Being very new to Go I had difficulties with combining the results of the DescribeDBParameters call in the GetAllParametersOfRdsInstanceE function. I wanted to have this function loop through the pages of the available parameters. So to get it working I setup the GetParameterValueForParameterOfRdsInstanceE function to also return the Marker token to the calling process and then setup a loop in the GetParameterValueForParameterOfRdsInstanceE function to use the token to reference the next set. I can submit PR with this fix.....

@brikis98
Copy link
Member

PR welcome, thank you! Note that we probably have other code in this repo, and code in many other Go repos, that use the Marker token pattern to fetch all results if you need a reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants