Skip to content
This repository was archived by the owner on Jul 3, 2023. It is now read-only.
This repository was archived by the owner on Jul 3, 2023. It is now read-only.

ClusterContainsContainerInstancesException #38

Open

Description

@tomdavidson

Im more than a bit excited about Stack. This is not nit picking, but sharing info because I experience quite a few issues. Using Terrafrom 0.6.16.

On a fresh and branch new stack I have the following plan:


module "autoreg_stack" {
  source      = "github.com/segmentio/stack"
  environment = "iac"
  key_name    = "autoreg"
  name        = "autoreg-stack"
  domain_name = "autoreg-stack.local"
  region      = "us-west-2"
  availability_zones  = "us-west-2a,us-west-2b,us-west-2c"
  cidr        = "192.168.0.0/16"
  internal_subnets  = "192.168.0.0/19,192.168.64.0/19,192.168.128.0/19"
  external_subnets  = "192.168.32.0/20,192.168.96.0/20,192.168.160.0/20"
  ecs_instance_type = "t2.small"
  ecs_instance_ebs_optimized  = false
}

Unfortunately, apply does not make it all the way through:

Error applying plan:

1 error(s) occurred:

* aws_ecs_cluster.main: ClusterContainsContainerInstancesException: The Cluster cannot be deleted while Container Instances are active.
        status code: 400, request id: 8bc05c80-5089-11e6-a6e1-7bf5f1238842

But if I plan and apply again, then Terrafrom says there are no changes to be made.

Activity

  1. achille-roussel commented on Jul 27, 2016

    @achille-roussel
    Contributor

    That is really odd... the error comes from the AWS API.

    We're working with 0.6.15 here, so either the stack code relies on a bug prior to 0.6.16 or the latest terraform has introduced an issue (the latter seems more likely to me).

    Can we confirm that there was no ECS cluster in your AWS account when you ran the first time?

  2. tomdavidson commented on Jul 27, 2016

    @tomdavidson
    ContributorAuthor

    Tired 0.6.15 - same symptoms. There might have been an ECS cluster from a previous Stack experiment but it would have had a different name - are the modules created in such a way I can only have one Stack per AWS account?

  3. achille-roussel commented on Jul 28, 2016

    @achille-roussel
    Contributor

    Things should work if you give a different name to your stacks and use different subnets etc... are all the stacks you use named differently?

  4. tomdavidson commented on Jul 28, 2016

    @tomdavidson
    ContributorAuthor

    Yes, all named differently. Only two stacks in my test account. The second stack was just to see if it would happen again. Right now I am not able to reproduce because both stacks give me a cycle error #37

    (Happen to know of a util to wipe out all provisioned resources of an aws account?)

  5. andersonkyle commented on Mar 1, 2017

    @andersonkyle
    Contributor

    Charity Majors recommends tagging all resources with something like terraform: true. See this for more detail.

    That way you can be more surgical when destroying resources out of band.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions