hey <@U028H7VT5P0>! Got my testing account set up,...
# fleet
b
hey @Benjamin Edwards! Got my testing account set up, trying to spin up an instance and I'm getting this error when trying to run
terraform apply -target module.fleet.module.vpc
Copy code
Error: creating EC2 Subnet: InvalidParameterValue: Value (us-east-2b) for parameter availabilityZone is invalid. Subnets can currently only be created in the following availability zones: us-east-1a, us-east-1b, us-east-1c, us-east-1d, us-east-1e, us-east-1f.
│       status code: 400, request id: 23b75412-c81c-4c2f-8d05-579e8c8b297f
│
│   with module.fleet.module.vpc.aws_subnet.public[1],
│   on .terraform\modules\fleet.vpc\<http://main.tf|main.tf> line 97, in resource "aws_subnet" "public":
│   97: resource "aws_subnet" "public" {
This repeats for
us-east-2a
,
us-east-2b
, and
us-east-2c
on
aws_subnet.public
,
aws_subnet.private
,
aws_subnet.database
, and
aws_subnet.elasticache
Is this an issue with my AWS account? Could it be region limited?
b
I think that is because of the default values in the vpc config: https://github.com/fleetdm/fleet/blob/c6d51511983e688c213423d857a421221e8347bb/terraform/variables.tf#L32 if you want to run in
us-east-1
you'd need to do something like:
Copy code
module "fleet" {
  source          = "github.com/fleetdm/fleet//terraform?ref=tf-mod-root-v1.7.1"

  vpc_config = {
    name = var.vpc_name
    azs = ["us-east-1a", "us-east-1b", ""us-east-1c"]
  }

  ...other configs
}
or it might be your default region on your AWS profile
and then terraform is picking that up
b
Yeah the profile is configured for us east, so I'm not sure why it's not reading it but manually switching the azs variable did the trick! Thanks!
b
sweet
b
Hey ben! Hopping back on this today and tried to deploy fleet with MDM enabled, and I'm getting this error when the migration script runs
Copy code
module.migrations.null_resource.main (local-exec): Waiter ServicesStable failed: Max attempts exceeded
╷
│ Error: local-exec provisioner error
│
│   with module.migrations.null_resource.main,
│   on .terraform/modules/migrations/terraform/addons/migrations/main.tf line 7, in resource "null_resource" "main":
│    7:   provisioner "local-exec" {
│
│ Error running command '/bin/bash .terraform/modules/migrations/terraform/addons/migrations/migrate.sh REGION=us-east-1 ECS_CLUSTER=fleet TASK_DEFINITION=fleet TASK_DEFINITION_REVISION=2 SUBNETS=["subnet-001fe1d39bf05f8bb","subnet-02c1de21a08c3423e","subnet-0c04ac2225b065d25"]
│ SECURITY_GROUPS=["sg-0fcfaea3426466769"] ECS_SERVICE=fleet MIN_CAPACITY=1 DESIRED_COUNT=1': exit status 255. Output: e2a19-31b4-4967-a5c2-bbf3cd1fcfff",
│                 "createdAt": "2024-03-20T17:50:08.017000-04:00",
│                 "message": "(service fleet) deregistered 1 targets in (target-group arn:aws:elasticloadbalancing:us-east-1:703235155488:targetgroup/fleet/47d4ffbb31ad3d90)"
│             },
......
I'm seeing different solutions online about this particular error but wanted to see if you had an idea before I started trying things
b
Can you attempt running minimum 2 fargate tasks vs 1 and see if that helps? I’m speculating that it’s having issues with min count available
b
on it!
same error! except now the MIN_CAPACITY equals 2