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

Issue with aws provider 1.11, 1.13, aws_launch_configuration & aws_autoscaling_group #4056

Closed
mukund1989 opened this issue Apr 4, 2018 · 3 comments
Labels
bug Addresses a defect in current functionality. stale Old or inactive issues managed by automation, if no further action taken these will get closed.

Comments

@mukund1989
Copy link

mukund1989 commented Apr 4, 2018

Terraform Version

0.10.6

AWS Provider Version

Issue appears on both aws provider 1.11 & 1.13

Affected Resource(s)

aws_launch_configuration
aws_autoscaling_group

Terraform Configuration Files

resource "aws_launch_configuration" "master" {
  name_prefix          = "master-${var.cluster}-"
  iam_instance_profile = "${aws_iam_instance_profile.master.name}"
  image_id             = "${var.ubuntu_ami}"
  instance_type        = "${lookup(var.instance_type, var.cluster_size)}"
  key_name             = "${coalesce(var.ssh_key_name, data.terraform_remote_state.vpc.ssh_key_name)}"

  user_data = "${data.template_cloudinit_config.master.rendered}"


  # Storage
  root_block_device {
    volume_size = "${var.root_disk_size}"
    volume_type = "gp2"
  }

  security_groups = [
    "${aws_security_group.master.id}",
  ]

  lifecycle {
    create_before_destroy = true
  }
}

resource "aws_autoscaling_group" "masters" {
  name = "master-${var.cluster}"

  default_cooldown          = 6
  desired_capacity          = "${var.instance_count}"
  max_size                  = "${var.instance_count}"
  min_size                  = "${var.instance_count}"
  health_check_grace_period = 3
  health_check_type         = "EC2"
  force_delete              = true
  launch_configuration      = "${aws_launch_configuration.master.name}"
  target_group_arns         = ["${aws_lb_target_group.master_ext_tg.arn}"]
  vpc_zone_identifier       = ["${values(data.terraform_remote_state.vpc.subnets_control_map)}"] 
}

Debug Output

Expected Behavior

What should have happened?

A successful plan indicating the below resources to add:

  • module.masters.aws_launch_configuration.master
    id:
    associate_public_ip_address: "false"
    ebs_block_device.#:
    ebs_optimized:
    enable_monitoring: "true"
    iam_instance_profile: "master-aws-use1-xxxx-xxxx"
    image_id: "ami-xxxx"
    instance_type: "m4.xlarge"
    key_name: "aws-use1-xxxx-xxxx"
    name:
    name_prefix: "master-aws-use1-xxxx-xxxx"
    root_block_device.#: "1"
    root_block_device.0.delete_on_termination: "true"
    root_block_device.0.iops:
    root_block_device.0.volume_size: "20"
    root_block_device.0.volume_type: "gp2"
    security_groups.#:
    user_data: "a529126e049c3263f29b00637cd24eb1775c5d8e"

  • module.masters.aws_autoscaling_group.masters
    id:
    arn:
    default_cooldown: "6"
    desired_capacity: "3"
    force_delete: "true"
    health_check_grace_period: "3"
    health_check_type: "EC2"
    launch_configuration: "${aws_launch_configuration.master.name}"
    load_balancers.#:
    max_size: "3"
    metrics_granularity: "1Minute"
    min_size: "3"
    name: "master-aws-use1-xxxx-xxxx"
    protect_from_scale_in: "false"
    target_group_arns.#:
    vpc_zone_identifier.#: "4"
    vpc_zone_identifier.1003057897: "subnet-xxxxxx"
    vpc_zone_identifier.2931960226: "subnet-xxxxxx"
    vpc_zone_identifier.3016417446: "subnet-xxxxxx"
    vpc_zone_identifier.3107657178: "subnet-xxxxxx"
    wait_for_capacity_timeout: "10m"

Actual Behavior

What actually happened?

Error: Error running plan: 1 error(s) occurred:

* module.masters.aws_autoscaling_group.masters: 1 error(s) occurred:

* module.masters.aws_autoscaling_group.masters: Resource 'aws_launch_configuration.master' not found for variable 'aws_launch_configuration.master.name'

Steps to Reproduce

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

  1. terraform plan

Important Factoids

The same code worked a few days ago with the same version of TF 0.10.6 and aws provider 1.11.0. What changed in the last few days? I tried using aws provider 1.13.0 but Terraform crashes with below error which I believe was fixed in #3962 but unfortunately that is not the case.

github.com/terraform-providers/terraform-provider-aws/aws.flattenAwsLbTargetGroupResource(0xc422242310, 0x262f260, 0xc42019ca00, 0xc42115c360, 0x0, 0xc422290b30)

References

@mukund1989 mukund1989 changed the title Issue with aws provider 0.11.3, aws_launch_configuration & aws_autoscaling_group Issue with aws provider 1.11, 1.13, aws_launch_configuration & aws_autoscaling_group Apr 4, 2018
@catsby catsby added the bug Addresses a defect in current functionality. label Apr 5, 2018
@catsby
Copy link
Contributor

catsby commented Apr 5, 2018

Hello – I believe this is related to #13510 as you noted there.

@github-actions
Copy link

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Mar 27, 2020
@ghost
Copy link

ghost commented May 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators May 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. stale Old or inactive issues managed by automation, if no further action taken these will get closed.
Projects
None yet
Development

No branches or pull requests

2 participants