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

Fixing aws_route difference after apply. #5321

Closed
wants to merge 3 commits into from

Conversation

BSick7
Copy link
Contributor

@BSick7 BSick7 commented Feb 25, 2016

Fixes #4311.

@BSick7
Copy link
Contributor Author

BSick7 commented Feb 26, 2016

@radeksimko Ran go fmt.

@stack72
Copy link
Contributor

stack72 commented Mar 9, 2016

@BSick7 FYI, I am currently testing this change so will have a look and see :)

@stack72 stack72 self-assigned this Mar 9, 2016
@stack72
Copy link
Contributor

stack72 commented Mar 9, 2016

Before applying the code:

4311 % terraform apply
aws_vpc.test: Creating...
  cidr_block:                "" => "10.10.0.0/16"
  default_network_acl_id:    "" => "<computed>"
  default_security_group_id: "" => "<computed>"
  dhcp_options_id:           "" => "<computed>"
  enable_classiclink:        "" => "<computed>"
  enable_dns_hostnames:      "" => "<computed>"
  enable_dns_support:        "" => "<computed>"
  main_route_table_id:       "" => "<computed>"
aws_vpc.test: Creation complete
aws_route_table.test: Creating...
  route.#: "" => "<computed>"
  vpc_id:  "" => "vpc-926254f6"
aws_subnet.test: Creating...
  availability_zone:       "" => "us-east-1b"
  cidr_block:              "" => "10.10.10.0/24"
  map_public_ip_on_launch: "" => "0"
  vpc_id:                  "" => "vpc-926254f6"
aws_route_table.test: Creation complete
aws_subnet.test: Creation complete
aws_instance.nat: Creating...
  ami:                      "" => "ami-184dc970"
  availability_zone:        "" => "<computed>"
  ebs_block_device.#:       "" => "<computed>"
  ephemeral_block_device.#: "" => "<computed>"
  instance_state:           "" => "<computed>"
  instance_type:            "" => "t2.nano"
  key_name:                 "" => "<computed>"
  placement_group:          "" => "<computed>"
  private_dns:              "" => "<computed>"
  private_ip:               "" => "<computed>"
  public_dns:               "" => "<computed>"
  public_ip:                "" => "<computed>"
  root_block_device.#:      "" => "<computed>"
  security_groups.#:        "" => "<computed>"
  source_dest_check:        "" => "1"
  subnet_id:                "" => "subnet-2a8a2600"
  tenancy:                  "" => "<computed>"
  vpc_security_group_ids.#: "" => "<computed>"
aws_instance.nat: Creation complete
aws_route.test: Creating...
  destination_cidr_block:     "" => "0.0.0.0/0"
  destination_prefix_list_id: "" => "<computed>"
  instance_id:                "" => "i-ccfa764f"
  instance_owner_id:          "" => "<computed>"
  origin:                     "" => "<computed>"
  route_table_id:             "" => "rtb-f443b993"
  state:                      "" => "<computed>"
aws_route.test: Creation complete

4311 % terraform plan
Refreshing Terraform state prior to plan...

aws_vpc.test: Refreshing state... (ID: vpc-926254f6)
aws_route_table.test: Refreshing state... (ID: rtb-f443b993)
aws_subnet.test: Refreshing state... (ID: subnet-2a8a2600)
aws_instance.nat: Refreshing state... (ID: i-ccfa764f)
aws_route.test: Refreshing state... (ID: r-rtb-f443b9931080289494)

The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed.

Note: You didn't specify an "-out" parameter to save this plan, so when
"apply" is called, Terraform can't guarantee this is what will execute.

~ aws_route.test
    network_interface_id: "eni-718b3b54" => ""

Continual changing in the plan

AFTER

4311 % terraform plan
Refreshing Terraform state prior to plan...

aws_vpc.test: Refreshing state... (ID: vpc-926254f6)
aws_subnet.test: Refreshing state... (ID: subnet-2a8a2600)
aws_route_table.test: Refreshing state... (ID: rtb-f443b993)
aws_instance.nat: Refreshing state... (ID: i-ccfa764f)
aws_route.test: Refreshing state... (ID: r-rtb-f443b9931080289494)

No changes. Infrastructure is up-to-date. This means that Terraform
could not detect any differences between your configuration and
the real physical resources that exist. As a result, Terraform
doesn't need to do anything.

No change. This is due to the fact that Computed: true

Acceptance Test Results:

make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSRoute_' 2>~/tf.log
==> Checking that code complies with gofmt requirements...
/Users/stacko/Code/go/bin/stringer
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSRoute_ -timeout 120m
=== RUN   TestAccAWSRoute_basic

--- PASS: TestAccAWSRoute_basic (97.65s)
=== RUN   TestAccAWSRoute_changeCidr
--- PASS: TestAccAWSRoute_changeCidr (149.81s)
=== RUN   TestAccAWSRoute_noopdiff
--- PASS: TestAccAWSRoute_noopdiff (227.41s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    474.898s

This looks good @BSick7 - going to squash the go fmt commit though to make sure the commit log reads well

@BSick7
Copy link
Contributor Author

BSick7 commented Mar 9, 2016

Sounds good @stack72. Thanks!

@stack72 stack72 closed this Mar 9, 2016
@steve-jansen
Copy link
Contributor

@stack72 did you mean to close this PR?

@stack72
Copy link
Contributor

stack72 commented Mar 9, 2016

@steve-jansen the PR has been manually merged :)

@stack72
Copy link
Contributor

stack72 commented Mar 9, 2016

To avoid confusion, this PR has been manually merged to squash commits

@ghost
Copy link

ghost commented Apr 27, 2020

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 ghost locked and limited conversation to collaborators Apr 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in aws_route_table when using network_interface_id/instance_id
4 participants