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
variable "cidr_block" {
description = "Address range for the VPC in CIDR notation"
}
variable "name" {
description = "Tag the VPC with this name"
}
variable "description" {
description = "Tag the VPC with this description"
}
variable "region" {
description = "AWS region to create in"
default = "us-east-1"
}
output "vpc_id" {
value = "${aws_vpc.vpc.id}"
}
output "route_table_id" {
value = "${aws_route_table.public.id}"
}
provider "aws" {
region = "${var.region}"
}
resource "aws_vpc" "vpc" {
cidr_block = "${var.cidr_block}"
tags {
Name = "${var.name}"
Description = "${var.description}"
}
}
resource "aws_internet_gateway" "gateway" {
vpc_id = "${aws_vpc.vpc.id}"
}
resource "aws_route_table" "public" {
vpc_id = "${aws_vpc.vpc.id}"
route {
cidr_block = "0.0.0.0/0"
gateway_id = "${aws_internet_gateway.gateway.id}"
}
tags {
Name = "${var.name}"
}
}
The first time this is applied, the VPC and route table are created as expected. If var.name is changed, the plan will show each resource being updated in place.
After this update plan is applied, terraform.tfstate will show the route table as having no entries, and terraform plan invoked again (with no variables changed) will show them being re-created:
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
May 4, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Given this configuration:
The first time this is applied, the VPC and route table are created as expected. If
var.name
is changed, the plan will show each resource being updated in place.After this update plan is applied,
terraform.tfstate
will show the route table as having no entries, andterraform plan
invoked again (with no variables changed) will show them being re-created:Which it does, but I would not expect the first update to clear the route table's entries.
The text was updated successfully, but these errors were encountered: