turnerlabs / terraform-ecs-fargate

A Terraform template used for provisioning web application stacks on AWS ECS Fargate
Apache License 2.0
425 stars 158 forks source link

Failed to get existing workspaces... #52

Open walshe opened 4 years ago

walshe commented 4 years ago

Hi..

im pretty new to TF.. seem to have run into the following issue .. any ideas?

➜ base git:(master) ✗ terraform state list data.aws_caller_identity.current data.aws_iam_policy_document.ecr aws_ecr_repository.app aws_ecr_repository_policy.app module.tf_remote_state.data.aws_iam_role.role module.tf_remote_state.aws_s3_bucket.bucket module.tf_remote_state.aws_s3_bucket_policy.bucket_policy ➜ base git:(master) ✗ cd ../env/dev ➜ dev git:(master) ✗ terraform init

Initializing the backend...

Error: Failed to get existing workspaces: InvalidParameter: 1 validation error(s) found.

jritsema commented 4 years ago

Hi @walshe. Make sure bucket and profile are set in main.tf to the values created in base. If you use fargate-create, it will do this for you.

walshe commented 4 years ago

hmm the one in env/dev right?

  required_version = ">= 0.12"

  backend "s3" {
    region  = "eu-west-1"
    profile = "default"
    bucket  = "tf-state-zoot"
    key     = "dev.terraform.tfstate"
  }
}

still getting that issue:


Outputs:

bucket = tf-state-zoot
docker_registry = xxxx.dkr.ecr.eu-west-1.amazonaws.com/zoot
➜  base git:(master) ✗ cd ../env/dev             
➜  dev git:(master) ✗ terraform init 

Initializing the backend...

Error: Failed to get existing workspaces: InvalidParameter: 1 validation error(s) found.
- minimum field size of 1, ListObjectsInput.Bucket.```
walshe commented 4 years ago

ok looks like it was something that was just cached.. have got further now.

Btw these scripts depend on existing vpc and subnets already being in place right ?

jritsema commented 4 years ago

Yes @walshe, the template does assume that you have an existing vpc/subnets that will be passed in as input variables. It also assumes that the vpc/subnets will be setup to have outbound internet access so that ECS can talk to the ECR service. We should probably be more explicit about that in the readme.