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

Eliminate the hardcoding of IP addresses in "3-networks hub & spoke" - use module variables and tfvars #1152

Closed
mromascanu123 opened this issue Mar 12, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@mromascanu123
Copy link

TL;DR

Examples
envs/development/main.tf
envs/non-production/main.tf
envs/production/main.tf
locals
...
module "base_env" {
...
enable_partner_interconnect = false
base_private_service_connect_ip = "10.17.0.2"
restricted_private_service_connect_ip = "10.17.0.6"

Also as an example in
envs/shared/hierarchical_firewall.tf
module "hierarchical_firewall_policy" {
rules = {
envs/shared/net-hubs-transitivity.tf, envs/shared/net-hubs.tf : in locals

etc...

Terraform Resources

No response

Detailed design

Ideally provide top level configuration propagated to modules
Or at least package top-level tfvar, included beneath,  files with instructions on parameterization

Additional information

No response

@mromascanu123 mromascanu123 added the enhancement New feature or request label Mar 12, 2024
@obriensystems
Copy link
Contributor

Prioritizing....

@mromascanu123
Copy link
Author

It is much more hardcoding around - hundreds of instances of it deep down in the code:
48 occurrences in the main.tf under 3-networks-hub-and-spoke/envs/ (development, production and non-production)
37 occurrences under 3-networks-hub-and-spoke/envs/shared/dns-hub.tf (dns-hub.tf, hierarchical_firewall.tf, net-hub-transitivity.tf, net-hubs.tf)
and 14 more under 3-networks-hub-and-spoke/modules
Similarly under 3-networks-dual-svpc

Then under 4-projects the subnet IP range is hardcodes in main.tf for each of the environments (development, production, non-production) for each of business_unit_1 and _2

All this hardcoding must be replaced with var-based expressions

And I would suggest to label it not as "enhancement" but "fixing poor coding practice"

@fmichaelobrien
Copy link
Contributor

@sleighton2022
Copy link
Collaborator

Put as part of backlog for #1226

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

No branches or pull requests

4 participants