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

Apply fails with "Launch configuration name not found" #302

Closed
bilalaslam opened this issue Sep 17, 2014 · 3 comments
Closed

Apply fails with "Launch configuration name not found" #302

bilalaslam opened this issue Sep 17, 2014 · 3 comments

Comments

@bilalaslam
Copy link

I saw a report of this issue on IRC didn't see an issue on Github, so here goes. I am seeing terraform apply fail with a ValidationError. This may be some sort of eventual consistency thing as Mitchell suggested.

I verified through the AWS console that the launch configuration named coreos indeed exists.

Error applying plan:

1 error(s) occurred:

* ValidationError: Launch configuration name not found - Launch configuration coreos not found

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

Offending .tf file:

resource "aws_security_group" "coreos" {
    name = "coreos"
    description = "CoreOS security group"

    ingress {
        from_port = 22
        to_port = 22
        protocol = "tcp"
        cidr_blocks = ["0.0.0.0/0"]
    }

    ingress {
        from_port = 4001
        to_port = 4001
        protocol = "tcp"
        cidr_blocks = ["0.0.0.0/0"]
    }

    ingress {
        from_port = 7001
        to_port = 7001
        protocol = "tcp"
        cidr_blocks = ["0.0.0.0/0"]
    }


    vpc_id = "${aws_vpc.default.id}"
}

resource "aws_autoscaling_group" "coreos" {
  availability_zones = ["${aws_instance.nat.availability_zone}"]
  name = "coreos"
  max_size = 12
  min_size = 3
  health_check_grace_period = 300
  health_check_type = "ELB"
  desired_capacity = 3
  force_delete = true
  launch_configuration = "${aws_launch_configuration.coreos.id}"
}

resource "aws_launch_configuration" "coreos" {
    name = "coreos"
    image_id = "${lookup(var.aws_coreos_amis, var.region)}"
    instance_type = "m3.medium"
    key_name = "${var.aws_key_name}"
    security_groups = ["${aws_security_group.coreos.id}"]

    user_data = "#cloud-config\n\ncoreos:\n  etcd:\n    discovery: ${var.coreos_token}\n    addr: $private_ipv4:4001\n    peer-addr: $private_ipv4:7001\n  units:\n    - name: etcd.service\n      command: start\n    - name: fleet.service\n      command: start"
}

@bilalaslam
Copy link
Author

This repros on 0.2.2 as well as master

@delitescere
Copy link

Vaguely similar to #304

@mitchellh
Copy link
Contributor

Fixed

@ghost ghost locked and limited conversation to collaborators May 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants