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

data and resource/aws_lex_bot data and resource/aws_lex_intent fails/incorrectly to find latest version when version count is greater than 9 #21045

Closed
thornleyk opened this issue Sep 25, 2021 · 2 comments · Fixed by #21122
Labels
bug Addresses a defect in current functionality. service/lexmodels Issues and PRs that pertain to the lexmodels service.
Milestone

Comments

@thornleyk
Copy link
Contributor

thornleyk commented Sep 25, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

1.0.7

Affected Resource(s)

  • aws_lex_bot
  • data/aws_lex_bot
  • aws_lex_intent
  • data/aws_lex_intent

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

Not a specific resource configuration but a pattern of use. This will occur for any users where the count of versions exceeds 9

Debug Output

Panic Output

No panic

Expected Behavior

New versions of intent or bot over the count of 9 should be correctly returned

Actual Behavior

Versions 1-9 work
Versions 10-19 returns 9
Versions 20 returns 20 etc

Additionally, it looks like the code on the first page will ignore the 10th version completely as it always expects 2 versions to always be in the response e.g. $LATEST and Version 1. this is not the case as the second page will not have $LATEST and the following block will break before picking up the 10th version

		// At least 1 version will always be returned.
		if len(page.Bots) == 1 {
			break
		}

Steps to Reproduce

Create more than 9 versions of your lex bot or intent

Important Factoids

  • The getLatestLexBotVersion and getLatestLexIntentVersion compares versions by string not integer so '9' is greater than '11'
  • The GetBotVersions default max result is 10
  • $LATEST will always be returned on the first page of 10 so we only have 9 actual versions on the first page
  • Subsequent pages do not have $LATEST

References

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/lexmodels Issues and PRs that pertain to the lexmodels service. labels Sep 25, 2021
@thornleyk thornleyk changed the title data/resource/aws_lex_bot fails/incorrectly to find latest version when version count is greater than 9 data and resource/aws_lex_bot data and resource/aws_lex_intent fails/incorrectly to find latest version when version count is greater than 9 Sep 25, 2021
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 27, 2021
@github-actions github-actions bot added this to the v3.62.0 milestone Oct 5, 2021
@github-actions
Copy link

github-actions bot commented Oct 8, 2021

This functionality has been released in v3.62.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

github-actions bot commented Jun 3, 2022

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/lexmodels Issues and PRs that pertain to the lexmodels service.
Projects
None yet
2 participants