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

feat: Add dedicated custom firewall rules module #200

Merged
merged 23 commits into from
Feb 9, 2021
Merged

Conversation

umairidris
Copy link
Contributor

@umairidris
Copy link
Contributor Author

@morgante @bharathkkb my test seems to be hitting Step #18 - "converge delete-default-gateway-routes-local": Error: Error waiting to create Network: Error waiting for Creating Network: Quota 'NETWORKS' exceeded. Limit: 5.0 globally.

Any recommendation on this? The test seems unrelated to mine, but seems like there might be too many networks being created in the project. Should I merge the firewalls test with another test?

@umairidris umairidris changed the title [WIP] Add dedicated custom firewall rules module Add dedicated custom firewall rules module Aug 14, 2020
@umairidris umairidris changed the title Add dedicated custom firewall rules module [WIP] Add dedicated custom firewall rules module Aug 14, 2020
@bharathkkb
Copy link
Member

Hi @umairidris
That seems right. I think merging tests are fine for this use case.
Another approach we did for GKE is spin up multiple projects in setup. terraform-google-modules/terraform-google-kubernetes-engine@b06c425

@umairidris
Copy link
Contributor Author

Thanks Bharath. I'll go with the merge approach for now.

@umairidris
Copy link
Contributor Author

So I added the checks under secondary ranges, but verify simple-project-with-regional-network-local seems to be failing, which wasn't affected by this PR. Is it a known issue?

>>>>>> Verify failed on instance <simple-project-with-regional-network-local>. Please see .kitchen/logs/simple-project-with-regional-network-local.log for more details

@umairidris umairidris changed the title [WIP] Add dedicated custom firewall rules module Add dedicated custom firewall rules module Aug 17, 2020
@bharathkkb
Copy link
Member

@umairidris that's odd last commit to main seems green, I will take a look.

variable "rules" {
description = "List of custom rule definitions (refer to variables file for syntax)."
default = []
type = list(object({
Copy link
Member

Choose a reason for hiding this comment

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

I see that we require object here but in the main module take in any and convert into this list of objects for this submodule? Is there a reason why we just take in any here and and do the defaults lookup here?

I am thinking if users want to use this submod outside of main module, they will need to define everything since its a list of objects.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally we should use list of objects everywhere. However as you pointed out users will need to define all variables possible through this. I chose to make the submodule list of objects to increase type checking while temporarily keeping the main module as type any until Terraform supports object defaults.

I thought that was a decent compromise (if someone wants type checking they can use submodule but if they want a simpler interface then the main module implements that). Also, I was going to implement both as list of objects, but then the firewall rules would have a very different interface compared to the other fields such as subnets.

I am ok with whatever you guys suggest. If you want any for both levels then I can make the change.

Copy link
Member

Choose a reason for hiding this comment

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

On further thought, I think if users want to ignore type checking they can just wrap the fw submodule like we do with main module. On a side note, I don't think defaults are slated till 0.14.0 😞

@bharathkkb
Copy link
Member

@umairidris looks like we have not pinned the CI images yet maybe thats why. Could you try pinning both images in lint and int CB yamls to 0.12.0? Example: terraform-google-modules/terraform-google-kubernetes-engine@e840f96

@umairidris
Copy link
Contributor Author

/gcbrun

@umairidris
Copy link
Contributor Author

Success! Thanks @bharathkkb. I still saw the failure for the test come up once more, but running /gcbrun to retry seems to have passed it, so it seems that specific test is a bit flaky for whatever reason.

@umairidris
Copy link
Contributor Author

/gcbrun

Copy link
Member

@bharathkkb bharathkkb left a comment

Choose a reason for hiding this comment

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

Overall LGTM
Just a question

modules/firewall-rules/main.tf Show resolved Hide resolved
@umairidris umairidris changed the title Add dedicated custom firewall rules module feat: Add dedicated custom firewall rules module Sep 9, 2020
@umairidris umairidris requested a review from a team September 9, 2020 16:21
@github-actions
Copy link
Contributor

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the Stale label Jan 25, 2021
@morgante
Copy link
Contributor

@umairidris Sorry we left this sitting for a while, do you mind resolving conflicts so we can merge?

@morgante morgante removed the Stale label Jan 26, 2021
@comment-bot-dev
Copy link

Thanks for the PR! 🚀
✅ Lint checks have passed.

@umairidris
Copy link
Contributor Author

@morgante done.

Copy link
Contributor

@morgante morgante 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 your patience. 💯

@morgante morgante merged commit 24f2a0f into master Feb 9, 2021
*/

terraform {
required_version = ">=0.12.6, <0.14"
Copy link

@jmymy jmymy Feb 16, 2021

Choose a reason for hiding this comment

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

is this is a breaking change as module version 3.0 didn't require <0.14 and now 3.1 does? I was on module version 3.0 and TF 0.14.5. In order to update to module version 3.1, I must downgrade the TF version

Copy link

Choose a reason for hiding this comment

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

Copy link

Choose a reason for hiding this comment

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

and i just saw your pr for the fix (#245) ignore me.

@jmymy
Copy link

jmymy commented Feb 16, 2021

fyi : #247

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.

5 participants