Skip to content

Removing key_name from launch configs does not trigger an updated launch config. #1676

Open
@hashibot

Description

This issue was originally opened by @Juberstine as hashicorp/terraform#15944. It was migrated here as a result of the provider split. The original body of the issue is below.


I needed to remove the key_name attached to an instance created by an ASG via a LC.

But running plan showed no change to be made.

Terraform Version

v0.9.5

Affected Resource(s)

Please list the resources as a list, for example:

aws_launch_configuration
Terraform Configuration Files

Actual code block post update. The only change made here was the removal of key_name:

resource "aws_launch_configuration" "triton-as-conf" {
  name_prefix   = "triton-${var.name}-launch-conf"
  image_id      = "${var.container_host_ami}"
  instance_type = "${var.container_host_instance_type}"

  security_groups = [
    "${aws_security_group.ssh.id}",
    "${aws_security_group.web.id}",
    "${aws_security_group.self_reference.id}",
  ]

  user_data            = "${data.template_file.user_data.rendered}"
  iam_instance_profile = "${aws_iam_instance_profile.container_host.name}"

  lifecycle {
    create_before_destroy = true
  }
}

All vars are set.

Inside the launch configs, the only code change was the removal of:

key_name = "${aws_key_pair.deployer.key_name}"

The above var was set but the concept here is that removing key_name does not trigger the LC to change.

Expected Behavior

LC should have been recreated without key_name.

Actual Behavior

Nothing.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

terraform apply
Remove the key_name value from launch configs
terraform plan
terraform apply

Seems similar to the issue another user experience with EBS:

hashicorp/terraform#14826

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.service/autoscalingIssues and PRs that pertain to the autoscaling service.staleOld or inactive issues managed by automation, if no further action taken these will get closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions