pangeo-data / terraform-deploy

deployment of pangeo jupyterhub infrastructure with terraform
MIT License
19 stars 31 forks source link

Error creating AutoScaling Group #29

Closed TomAugspurger closed 4 years ago

TomAugspurger commented 4 years ago

Running terraform apply -var-file=aws-cluster.tfvars, I eventually hit

Error: Error creating AutoScaling Group: ValidationError: You must use a valid fully-formed launch template. You cannot use PartitionNumber with a Placement Group that does not exist. Specify a valid Placement Group and try again.
        status code: 400, request id: 01bd991d-e8ff-4bf9-af50-b5ec5d279950

  on .terraform/modules/eks/terraform-aws-eks-11.1.0/workers_launch_template.tf line 3, in resource "aws_autoscaling_group" "workers_launch_template":
   3: resource "aws_autoscaling_group" "workers_launch_template" {

Error: Error creating AutoScaling Group: ValidationError: You must use a valid fully-formed launch template. You cannot use PartitionNumber with a Placement Group that does not exist. Specify a valid Placement Group and try again.
        status code: 400, request id: 10d2f03d-820c-4f05-bca0-d16d9817470e

  on .terraform/modules/eks/terraform-aws-eks-11.1.0/workers_launch_template.tf line 3, in resource "aws_autoscaling_group" "workers_launch_template":
   3: resource "aws_autoscaling_group" "workers_launch_template" {

@salvis2 any guesses on why that would be? Any other info I should provide (first time using terraform).

salvis2 commented 4 years ago

I haven't created an autoscaling group with the base Terraform resource. I'm using their EKS module and specifying worker groups from within there.

Looking in that module's local.tf and workers_launch_template.tf, it seems the default placement group it an empty string. I've never specified that variable, and I can't find it with terraform state [asg_resource].

Reading the aws_autoscaling_group docs, I see they specify a placement group resource in the first example, but not in the others. The placement_group variable is listed as optional.

Did you just run the Terraform command in the aws/ directory? What config did you use?

TomAugspurger commented 4 years ago

The config is at https://github.com/pangeo-data/multicloud-demo/tree/master/aws/aws.

The command was

$ terraform apply -var-file=aws-cluster.tfvars  

I can keep poking at this.

I notice that the master branch has more .tf files in the aws/ directory. I based my setup off the blog branch. Could that be relevant?

TomAugspurger commented 4 years ago

@salvis2 discovered the issue: a recent update to the aws module: https://github.com/terraform-aws-modules/terraform-aws-eks/issues/874#event-3319611103

That's been fixed, but pinning to 2.59.0 for now worked.