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

fix: use try on length(var.subnets) #179

Merged
merged 2 commits into from
May 6, 2024
Merged

Conversation

nitrocode
Copy link
Member

what

  • fix: use try on length(var.subnets)

why

  • If the length is used without a try, if subnets are not passed in, the module will fail
  • The use case is when the rds component is deployed with enabled = false, it relies on the vpc component which may not be deployed yet. So the enabled: false flag is used for both the vpc and rds, however rds will still try to retrieve from the remote state vpc which will try to pass in a null list of subnets which causes this failure
  • A local plan against this branch results in the correct plan

references

N/A

@nitrocode nitrocode added the patch A minor, backward compatible change label May 4, 2024
@nitrocode nitrocode requested review from a team as code owners May 4, 2024 04:56
@nitrocode nitrocode enabled auto-merge (squash) May 4, 2024 04:57
@nitrocode
Copy link
Member Author

/terratest

Copy link
Member

@RoseSecurity RoseSecurity left a comment

Choose a reason for hiding this comment

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

Good catch on this finding!

@nitrocode
Copy link
Member Author

/terratest

@nitrocode nitrocode merged commit 8b6600c into main May 6, 2024
11 checks passed
@nitrocode nitrocode deleted the use-try-on-length-of-subnets branch May 6, 2024 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch A minor, backward compatible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants