GithubHelp home page GithubHelp logo

Comments (8)

antonbabenko avatar antonbabenko commented on May 27, 2024 1

@ranvijayj I won't be able to look into this issue before the weekend. I may have time, but can't promise. Business trip.

from terraform-aws-ec2-instance.

ranvijayj avatar ranvijayj commented on May 27, 2024

So, I do a terraform plan and apply
then without changing anything I do a terraform plan it still shows changes...

from terraform-aws-ec2-instance.

ranvijayj avatar ranvijayj commented on May 27, 2024

Sorry for another message here but I do terraform apply once resources get created. Then I again run ter plan changes show up

https://gist.github.com/ranvijayj/e6e8443c1f440d77990adf505114e195

I see root_block_device.0.delete_on_termination: "false" => "true" (forces new resource) Is changing even though I made no change...

from terraform-aws-ec2-instance.

ranvijayj avatar ranvijayj commented on May 27, 2024

ran the same thing but without using this module but a simple aws instance resource and did plan and apply mutiple times nothing showed changed...

https://gist.github.com/ranvijayj/d604c1475f4d8dcb4f0912f0898a710c

Why is it happening just with the module?

from terraform-aws-ec2-instance.

ranvijayj avatar ranvijayj commented on May 27, 2024

@antonbabenko Terraform guys just replied on https://github.com/hashicorp/terraform/issues/17120

If that helps.

So I do apply infra gets created. Then I do plan again without any changes still this shows up

  ~ aws_elb.web
      instances.#:                                       "" => <computed>

  ~ aws_route_table.r2
      route.1524334193.cidr_block:                       "0.0.0.0/0" => ""
      route.1524334193.egress_only_gateway_id:           "" => ""
      route.1524334193.gateway_id:                       "" => ""
      route.1524334193.instance_id:                      "" => ""
      route.1524334193.ipv6_cidr_block:                  "" => ""
      route.1524334193.nat_gateway_id:                   "nat-06b8414fa685bba9a" => ""
      route.1524334193.network_interface_id:             "" => ""
      route.1524334193.vpc_peering_connection_id:        "" => ""
      route.2514903375.cidr_block:                       "" => "0.0.0.0/0"
      route.2514903375.egress_only_gateway_id:           "" => ""
      route.2514903375.gateway_id:                       "" => "nat-06b8414fa685bba9a"
      route.2514903375.instance_id:                      "" => ""
      route.2514903375.ipv6_cidr_block:                  "" => ""
      route.2514903375.nat_gateway_id:                   "" => ""
      route.2514903375.network_interface_id:             "" => ""
      route.2514903375.vpc_peering_connection_id:        "" => ""

-/+ module.backend_api.aws_instance.instance (new resource required)
      id:                                                "i-010c7c20ea2530afb" => <computed> (forces new resource)
      ami:                                               "ami-7f675e4f" => "ami-7f675e4f"
      associate_public_ip_address:                       "false" => "false"
      availability_zone:                                 "us-west-2b" => <computed>
      disable_api_termination:                           "false" => "false"
      ebs_block_device.#:                                "0" => "1"
      ebs_block_device.3239300295.delete_on_termination: "" => "false" (forces new resource)
      ebs_block_device.3239300295.device_name:           "" => "/dev/sda1" (forces new resource)
      ebs_block_device.3239300295.encrypted:             "" => <computed> (forces new resource)
      ebs_block_device.3239300295.snapshot_id:           "" => <computed> (forces new resource)
      ebs_block_device.3239300295.volume_id:             "" => <computed>
      ebs_block_device.3239300295.volume_size:           "" => "50" (forces new resource)
      ebs_block_device.3239300295.volume_type:           "" => "gp2" (forces new resource)
      ebs_optimized:                                     "false" => "false"
      instance_state:                                    "running" => <computed>
      instance_type:                                     "t2.micro" => "t2.micro"
      ipv6_address_count:                                "0" => "0"
      key_name:                                          "terraform_acc" => "terraform_acc"
      monitoring:                                        "true" => "true"
      network_interface.#:                               "0" => <computed>
      network_interface_id:                              "eni-42321460" => <computed>
      placement_group:                                   "" => <computed>
      primary_network_interface_id:                      "eni-42321460" => <computed>
      private_dns:                                       "ip-10-2-0-229.us-west-2.compute.internal" => <computed>
      private_ip:                                        "10.2.0.229" => <computed>
      public_dns:                                        "" => <computed>
      public_ip:                                         "" => <computed>
      root_block_device.#:                               "1" => "0"
      root_block_device.0.delete_on_termination:         "false" => "true" (forces new resource)
      security_groups.#:                                 "0" => <computed>
      source_dest_check:                                 "true" => "true"
      subnet_id:                                         "subnet-7e534d18" => "subnet-7e534d18"
      tags.%:                                            "3" => "3"
      tags.Environment:                                  "dev" => "dev"
      tags.Name:                                         "dev-cel-1" => "dev-cel-1"
      tags.Terraform:                                    "true" => "true"
      tenancy:                                           "default" => "default"
      user_data:                                         "da39a3ee5e6b4b0d3255bfef95601890afd80709" => "da39a3ee5e6b4b0d3255bfef95601890afd80709"
      volume_tags.%:                                     "0" => <computed>
      vpc_security_group_ids.#:                          "1" => "1"
      vpc_security_group_ids.275182154:                  "sg-bf3833c3" => "sg-bf3833c3"

-/+ module.frontend_api.aws_instance.instance (new resource required)
      id:                                                "i-0008b5a60457f6b3c" => <computed> (forces new resource)
      ami:                                               "ami-7f675e4f" => "ami-7f675e4f"
      associate_public_ip_address:                       "false" => "false"
      availability_zone:                                 "us-west-2b" => <computed>
      disable_api_termination:                           "false" => "false"
      ebs_block_device.#:                                "0" => "1"
      ebs_block_device.3239300295.delete_on_termination: "" => "false" (forces new resource)
      ebs_block_device.3239300295.device_name:           "" => "/dev/sda1" (forces new resource)
      ebs_block_device.3239300295.encrypted:             "" => <computed> (forces new resource)
      ebs_block_device.3239300295.snapshot_id:           "" => <computed> (forces new resource)
      ebs_block_device.3239300295.volume_id:             "" => <computed>
      ebs_block_device.3239300295.volume_size:           "" => "50" (forces new resource)
      ebs_block_device.3239300295.volume_type:           "" => "gp2" (forces new resource)
      ebs_optimized:                                     "false" => "false"
      instance_state:                                    "running" => <computed>
      instance_type:                                     "t2.micro" => "t2.micro"
      ipv6_address_count:                                "0" => "0"
      key_name:                                          "terraform_acc" => "terraform_acc"
      monitoring:                                        "true" => "true"
      network_interface.#:                               "0" => <computed>
      network_interface_id:                              "eni-23311701" => <computed>
      placement_group:                                   "" => <computed>
      primary_network_interface_id:                      "eni-23311701" => <computed>


      private_dns:                                       "ip-10-2-0-239.us-west-2.compute.internal" => <computed>
      private_ip:                                        "10.2.0.239" => <computed>
      public_dns:                                        "" => <computed>
      public_ip:                                         "" => <computed>
      root_block_device.#:                               "1" => "0"
      root_block_device.0.delete_on_termination:         "false" => "true" (forces new resource)
      security_groups.#:                                 "0" => <computed>
      source_dest_check:                                 "true" => "true"
      subnet_id:                                         "subnet-7e534d18" => "subnet-7e534d18"
      tags.%:                                            "3" => "3"
      tags.Environment:                                  "dev" => "dev"
      tags.Name:                                         "dev-app-1" => "dev-app-1"
      tags.Terraform:                                    "true" => "true"
      tenancy:                                           "default" => "default"
      user_data:                                         "da39a3ee5e6b4b0d3255bfef95601890afd80709" => "da39a3ee5e6b4b0d3255bfef95601890afd80709"
      volume_tags.%:                                     "0" => <computed>
      vpc_security_group_ids.#:                          "1" => "1"
      vpc_security_group_ids.275182154:                  "sg-bf3833c3" => "sg-bf3833c3"


Plan: 2 to add, 2 to change, 2 to destroy.

------------------------------------------------------------------------

Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.

I Even downgraded my tf version from 0.11.2 to 0.11.0 hoping that would help, but no.

ubuntu@ip-172-31-11-8:~/aws-elb-multienv/dev$ ter --version
Terraform v0.11.0
+ provider.aws v1.7.0

Let me know if you want me to share my entire code.

from terraform-aws-ec2-instance.

ranvijayj avatar ranvijayj commented on May 27, 2024

Code: https://drive.google.com/open?id=1__aoVg0ksNDz1r7hSfAv2gizr-erWBTu

@antonbabenko

Screencapture: https://drive.google.com/file/d/1RgPYbzyR2HZPgCpFhBpdmHBNLBJcCJ3x/view?usp=sharing

from terraform-aws-ec2-instance.

antonbabenko avatar antonbabenko commented on May 27, 2024

Sorry for the delay in my response. I have just read the whole discussion, and the problem is in the following:

  1. https://github.com/terraform-aws-modules/terraform-aws-ec2-instance/blob/master/main.tf#L37-L42 - these lifecycle rules were added in v1.1.0 as a fix to the same issue as you are experiencing (see #10).
  2. The code you have referred in this comment does not have required lifecycle, so it is not working as expected.

Closing this issue.

from terraform-aws-ec2-instance.

github-actions avatar github-actions commented on May 27, 2024

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.

from terraform-aws-ec2-instance.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.