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: get availability zone from data source #137

Merged
merged 7 commits into from
Sep 13, 2023
Merged

Conversation

ugmuka
Copy link
Contributor

@ugmuka ugmuka commented Aug 20, 2023

What does this PR do?

When creating subnet, availability zone is hard coded. Fixed to get availability zone parameters from data source.

Motivation

In certain region, <region>-b az is not available(ex ap-northeast-1b).

More

  • Yes, I have tested the PR using my local account setup (Provide any test evidence report under Additional Notes)
  • Yes, I ran pre-commit run -a with this PR

For Moderators

  • E2E Test successfully complete before merge?

Additional Notes

Copy link
Contributor

@mgerlach mgerlach left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @ugmuka. Minor suggestions (as of the linter warnings).

vpc.tf Outdated Show resolved Hide resolved
vpc.tf Outdated Show resolved Hide resolved
ugmuka and others added 2 commits August 20, 2023 16:37
Co-authored-by: Martin Gerlach <gerlach.martin@gmail.com>
Signed-off-by: ugmuka <55133701+ugmuka@users.noreply.github.com>
Co-authored-by: Martin Gerlach <gerlach.martin@gmail.com>
Signed-off-by: ugmuka <55133701+ugmuka@users.noreply.github.com>
@ugmuka
Copy link
Contributor Author

ugmuka commented Aug 20, 2023

Thanks, I signed off your suggestion.

@mgerlach
Copy link
Contributor

mgerlach commented Aug 20, 2023

Thanks, I signed off your suggestion.

Ok. Checks are looking good now.

Two more things to consider:

Is it safe that the AZs are always returned in the same (alphabetical?) order by the data source?

And do we need to exclude local zones (see https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/availability_zones.html and look for the example "Only availability zones (no local zones)") ?

Just want to make sure that users do not get unwanted changes due to changes of the AZs returned by the data source.

I am on a short leave from work these days, checking only occasionally. Back on Wednesday. My colleague Jakob @jdiebold may be available Mon/Tue.

@mgerlach
Copy link
Contributor

mgerlach commented Aug 24, 2023

@ugmuka just realized that my second question is not relevant as you used the group-name filter.

Regarding the first question, order of AZs, I'll make a code suggestion.

Copy link
Contributor

@mgerlach mgerlach left a comment

Choose a reason for hiding this comment

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

Suggesting to sort the az names retrieved from the data source.

Also, could you please sync your fork with idealo:main?

vpc.tf Show resolved Hide resolved
vpc.tf Outdated Show resolved Hide resolved
vpc.tf Outdated Show resolved Hide resolved
@mgerlach
Copy link
Contributor

Hi @ugmuka , would my suggestions be ok? If yes, please apply them and rebase. Thx.

ugmuka and others added 3 commits September 13, 2023 12:43
Co-authored-by: Martin Gerlach <gerlach.martin@gmail.com>
Signed-off-by: ugmuka <55133701+ugmuka@users.noreply.github.com>
Co-authored-by: Martin Gerlach <gerlach.martin@gmail.com>
Signed-off-by: ugmuka <55133701+ugmuka@users.noreply.github.com>
Co-authored-by: Martin Gerlach <gerlach.martin@gmail.com>
Signed-off-by: ugmuka <55133701+ugmuka@users.noreply.github.com>
@ugmuka
Copy link
Contributor Author

ugmuka commented Sep 13, 2023

Sorry for the late reply, I signed off your commit.
If you want to rebase, I'll do it.

@mgerlach mgerlach merged commit 687bb9a into idealo:main Sep 13, 2023
4 checks passed
@github-actions
Copy link
Contributor

🎉 This PR is included in version 3.0.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants