Closed adartsecitizen closed 1 year ago
This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days
This issue was automatically closed because of stale in 10 days
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.
Hi Team,
I am using the public registry EC2 module -> terraform-aws-modules/ec2-instance/aws to test out the import functionality of Terraform 1.5.x. I created an EC2 instance using the module for the testing.
When I tried importing the EC2 instance using the same EC2 module (I deleted the terraform.tfstate to simulate), Terraform plan was showing 2 update in-place changes. I can't figure out where the change is coming from.
I am expecting no changes as I have used the same EC2 module and main.tf config - no changes in parameters. I only deleted the terraform.tfstate to simulate the import.
Is this a bug? Any insights on how to fix this? Thanks.
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: ~ update in-place
Terraform will perform the following actions:
module.ec2_private["0"].aws_instance.this[0] will be updated in-place
(imported from "i-0d9fc1c2d85639717")
~ resource "aws_instance" "this" { ami = "ami-0ee3dd41c47751fe6" arn = "arn:aws:ec2:us-east-1:163240833505:instance/i-0d9fc1c2d85639717" associate_public_ip_address = false availability_zone = "us-east-1a" cpu_core_count = 1 cpu_threads_per_core = 1 disable_api_stop = false disable_api_termination = false ebs_optimized = false get_password_data = false hibernation = false id = "i-0d9fc1c2d85639717" instance_initiated_shutdown_behavior = "stop" instance_state = "running" instance_type = "t2.micro" ipv6_address_count = 0 ipv6_addresses = [] key_name = "terraform-key-rc_is-lab_account" monitoring = false placement_partition_number = 0 primary_network_interface_id = "eni-0a025e9b1e5b4b948" private_dns = "ip-10-0-1-102.ec2.internal" private_ip = "10.0.1.102" secondary_private_ips = [] security_groups = [] source_dest_check = true subnet_id = "subnet-0ee9f8fc6fc759978" tags = { "Department" = "it" "Name" = "sandbox-vm-0" "Team" = "it-devops" "Terraform" = "true" "environment" = "sandbox" "owners" = "it" } tags_all = { "Department" = "it" "Name" = "sandbox-vm-0" "Team" = "it-devops" "Terraform" = "true" "environment" = "sandbox" "owners" = "it" } tenancy = "default"
user_data_replace_on_change = false
volume_tags = {
"Name" = "sandbox-vm-0" } vpc_security_group_ids = [ "sg-0b0776d70bd8c80c9", ]
capacity_reservation_specification { capacity_reservation_preference = "open" }
cpu_options { core_count = 1 threads_per_core = 1 }
credit_specification { cpu_credits = "standard" }
enclave_options { enabled = false }
maintenance_options { auto_recovery = "default" }
metadata_options { http_endpoint = "enabled" http_put_response_hop_limit = 1 http_tokens = "optional" instance_metadata_tags = "disabled" }
private_dns_name_options { enable_resource_name_dns_a_record = false enable_resource_name_dns_aaaa_record = false hostname_type = "ip-name" }
root_block_device { delete_on_termination = true device_name = "/dev/xvda" encrypted = false iops = 100 tags = { "Name" = "sandbox-vm-0" } throughput = 0 volume_id = "vol-0771f67580c18a268" volume_size = 8 volume_type = "gp2" }
timeouts {} }
module.private_sg.aws_security_group.this_name_prefix[0] will be updated in-place
(imported from "sg-0b0776d70bd8c80c9")
~ resource "aws_security_group" "this_name_prefix" { arn = "arn:aws:ec2:us-east-1:163240833505:security-group/sg-0b0776d70bd8c80c9" description = "Security group with HTTP & SSH port open for everybody (IPv4 CIDR), egress ports are all world open" egress = [ { cidr_blocks = [ "0.0.0.0/0", ] description = "All protocols" from_port = 0 ipv6_cidr_blocks = [] prefix_list_ids = [] protocol = "-1" security_groups = [] self = false to_port = 0 }, ] id = "sg-0b0776d70bd8c80c9" ingress = [ { cidr_blocks = [ "10.0.0.0/16", ] description = "HTTP" from_port = 80 ipv6_cidr_blocks = [] prefix_list_ids = [] protocol = "tcp" security_groups = [] self = false to_port = 80 }, { cidr_blocks = [ "10.0.0.0/16", ] description = "SSH" from_port = 22 ipv6_cidr_blocks = [] prefix_list_ids = [] protocol = "tcp" security_groups = [] self = false to_port = 22 }, ] name = "private-sg-20230716055903460900000001" name_prefix = "private-sg-" owner_id = "163240833505"
revoke_rules_on_delete = false tags = { "Department" = "it" "Name" = "private-sg" "Team" = "it-devops" "Terraform" = "true" "environment" = "sandbox" "owners" = "it" } tags_all = { "Department" = "it" "Name" = "private-sg" "Team" = "it-devops" "Terraform" = "true" "environment" = "sandbox" "owners" = "it" } vpc_id = "vpc-0c2e6db281af6595b"
timeouts {
Plan: 5 to import, 0 to add, 2 to change, 0 to destroy.
Changes to Outputs: