Comments (8)
@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.
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.
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.
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.
@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.
Code: https://drive.google.com/open?id=1__aoVg0ksNDz1r7hSfAv2gizr-erWBTu
Screencapture: https://drive.google.com/file/d/1RgPYbzyR2HZPgCpFhBpdmHBNLBJcCJ3x/view?usp=sharing
from terraform-aws-ec2-instance.
Sorry for the delay in my response. I have just read the whole discussion, and the problem is in the following:
- 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).
- 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.
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)
- EC2 module new variable "kms_create" HOT 1
- updating associate_public_ip_address should not cause ec2_instance to be replaced HOT 2
- Provision EC2 with FSXN filesystem HOT 3
- How can we create multiple ec2 instances with seperate network intefaces ? HOT 2
- Complement PR #239 with the ability to create spot instances which ignore AMI changes HOT 2
- Question: Change size of volumes getting attached when launching EC2 using an AMI that has multiple volumes HOT 3
- override vpc autoassign public_ip_address for created instance HOT 2
- add ignore associate_public_ip_address changes HOT 3
- main.tf line 12, in data "aws_ssm_parameter" "this": 12: count = local.create && var.ami == null ? 1 : 0 HOT 5
- disable_api_termination error HOT 1
- Add feature to specify custom lifecycle rules HOT 2
- ebs_block_device - # forces replacement HOT 2
- Add public static ip support for ec2 HOT 4
- v5.3.1 does not fix "ami variable when using without ssm" for fresh apply HOT 3
- Additional recreate triggers HOT 3
- Add support for network_card_index argument for network interfaces HOT 2
- Add support for launching into EC2 Capacity Blocks reservation HOT 2
- Access to metadata service returns 401 unauthorized HOT 4
- Allow creation of no-delete EC2 instances HOT 1
- Support for Automatic Recovery Configuration HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-aws-ec2-instance.