Replies: 2 comments
-
@bangupoc is the custom CIDR block in addition to the defaults we set up or are you attempting to override the defaults? |
Beta Was this translation helpful? Give feedback.
0 replies
-
@bangupoc There is two way to generate the cidr for the subnet using gruntwork module:
Note: If lesser cidr range are used then calculation need to be exact to avoid the error with the subnet cidr range. If you are using /16 then there would be no any error in the subnet spacing and if /23 are used then you calculation need to be specific and exact. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
We have provided a custom CIDR block and Subnet range for our application but when we executed the code its not considering all the subnet details it is randomly providing the Subnet IP Ips during the plan some are from the given list, and some are auto generated.
Initially we identified that we need to use the cidrsubnet terraform function for calculating the subnets and used the terraform console for the given cidr_block
e.g. cidrsubnet("10.90.0.0/16", 5, 0) and we generated the required subnet list,
But while performing the terraform plan. details are random as mentioned.
Can you please let us know whats the issue here ? For some reason the IP ranges which we have provided is not getting considered and random values are been generated.
Sample file
inputs = {
vpc_name = "kuber_private_vpc"
cidr_block = "10.90.0.0/16"
num_nat_gateways = 3
num_availability_zones = 3
public_subnet_cidr_blocks = {
"public-application-AZ-0" = "10.90.0.0/21"
"public-application-AZ-1" = "10.90.8.0/21"
"public-application-AZ-2" = "10.90.16.0/21"
}
private_app_subnet_cidr_blocks = {
"private-application-AZ-0" = "10.90.24.0/21"
"private-application-AZ-1" = "10.90.32.0/21"
"private-application-AZ-2" = "10.90.40.0/21"
"private-cache-AZ-0" = "10.90.48.0/21"
"private-cache-AZ-1" = "10.90.56.0/21"
"private-cache-AZ-2" = "10.90.64.0/21"
"private-databse-AZ-0" = "10.90.72.0/21"
"private-databse-AZ-1" = "10.90.80.0/21"
"private-databse-AZ-2" = "10.90.88.0/21"
}
custom_tags = {
"project" = "test"
"application" = "test-application"
"resource-type" = "network"
}
nat_gateway_custom_tags = {
"project" = "test"
"application" = "test-application"
"resource-type" = "network"
}
}
Tracked in ticket #109791
Beta Was this translation helpful? Give feedback.
All reactions