You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[root@dathost terraform1]# variable.tf
variable "name" {}
variable "tags" {
description = "A map of tags to add to all resources"
default = {}
}
[root@dathost terraform1]# output.tf
output "vpc_id" {
value = "${aws_vpc.mod.id}"
}
First terraform apply gave cidr as 0.0.0.0/0 which said 0.0.0.0/0 cidr is invalid which is expected.
[root@dathost terraform1]# terraform apply
var.name
Enter a value: datta
[root@dathost terraform1]# terraform plan
var.name
Enter a value: datta
1 error(s) occurred:
aws_vpc.mod: "cidr_block" must contain a valid network CIDR, expected "0.0.0.0/0", got "20.0.0.0/0"
Expected Behavior
Expected error in #2 would be like * aws_vpc.mod: "cidr_block" must contain a valid network CIDR, expected "x.0.0.0/y", got "20.0.0.0/0"
Or instead of x.0.0.0/y we could provide any valid cidr like "10.0.0.0/8" or "10.0.0.0/16"
If 0.0.0.0/0 is invalid , why shold we show it in warning.
Actual Behavior
aws_vpc.mod: "cidr_block" must contain a valid network CIDR, expected "0.0.0.0/0", got "20.0.0.0/0"
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform plan when cidr is "0.0.0.0/0"
terraform plan when cidr is "20.0.0.0/0"
The text was updated successfully, but these errors were encountered:
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
ghost
locked and limited conversation to collaborators
Apr 11, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Terraform Version
Terraform v0.9.6
Terraform Configuration Files
[root@dathost terraform1]# main.tf
resource "aws_vpc" "mod" {
cidr_block = "20.0.0.0/16"
tags = "${merge(var.tags, map("Name", format("%s", var.name)))}"
}
[root@dathost terraform1]# variable.tf
variable "name" {}
variable "tags" {
description = "A map of tags to add to all resources"
default = {}
}
[root@dathost terraform1]# output.tf
output "vpc_id" {
value = "${aws_vpc.mod.id}"
}
[root@dathost terraform1]# terraform apply
var.name
Enter a value: datta
aws_vpc.mod: Creating...
assign_generated_ipv6_cidr_block: "" => "false"
cidr_block: "" => "0.0.0.0/0"
default_network_acl_id: "" => ""
default_route_table_id: "" => ""
default_security_group_id: "" => ""
dhcp_options_id: "" => ""
enable_classiclink: "" => ""
enable_dns_hostnames: "" => ""
enable_dns_support: "" => "true"
instance_tenancy: "" => ""
ipv6_association_id: "" => ""
ipv6_cidr_block: "" => ""
main_route_table_id: "" => ""
tags.%: "" => "1"
tags.Name: "" => "datta"
Error applying plan:
1 error(s) occurred:
aws_vpc.mod: 1 error(s) occurred:
aws_vpc.mod: Error creating VPC: InvalidVpc.Range: The CIDR '0.0.0.0/0' is invalid.
status code: 400, request id: 8f2f8642-14bc-4071-96b1-04a19d6a4634
[root@dathost terraform1]# terraform plan
var.name
Enter a value: datta
1 error(s) occurred:
Expected Behavior
Expected error in #2 would be like * aws_vpc.mod: "cidr_block" must contain a valid network CIDR, expected "x.0.0.0/y", got "20.0.0.0/0"
Or instead of x.0.0.0/y we could provide any valid cidr like "10.0.0.0/8" or "10.0.0.0/16"
If 0.0.0.0/0 is invalid , why shold we show it in warning.
Actual Behavior
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform plan
when cidr is "0.0.0.0/0"terraform plan
when cidr is "20.0.0.0/0"The text was updated successfully, but these errors were encountered: