How do I use terraform to run mwaa on Localstack

Hi,
I have built out all my architecture and it is breaking when I try run mwaa with terraform on Localstack pro. I have followed the guidelines in creating a mwaa environment with no vpn according to this github link (GitHub - claudiobizzotto/aws-mwaa-terraform: AWS MWAA Quick Start With Terraform.). I get the error

Put “ht://api.localhost:4566/environments/spark-app-demo-mwaa-environment-dev”: dial tcp: lookup api.localhost: no such host

Please assist me in solving this or should I be using the aws-mwaa-local-runner as a docker container seperately?

I have created an endpoint in my main.tf for mwaa with the localhost:4566:

The module for the mwaa looks like below:

locals {
  common_tags = {
    Terraform = true
    Environment = "${var.environment}"
    Project = "${var.project}"
    Region = "${var.region}"
  }
}
###had a circular dependency so need to add this here

resource "aws_mwaa_environment" "mwaa_environment" {
  source_bucket_arn     = "${var.airflow_s3_bucket_arn}"
  dag_s3_path           = "dags"
  #requirements_s3_path  = "${var.requirements_s3_path}" #dont need to use this as the requirments is not set by default
  execution_role_arn    = "${var.airflow_iam_role}"
  name                  = "${var.name}-${var.project}-mwaa-environment-${var.environment}"
  min_workers           =  1
  max_workers           = "${var.mwaa_max_workers}"

  #vpc_id                = "${var.vpc_id}"
  #private_subnet_ids    = "${var.airflow_mwaa_subnets}" #dont need this
    #changing to work with public airflow URL 
  webserver_access_mode = "PUBLIC_ONLY"

  network_configuration {
    security_group_ids = [var.emr_mwaa_security_group]
    subnet_ids         = var.private_subnets_ids #$"{var.mwaa_subnets}" need this as they
  }

#airflow example shows empty configuration for this
  #network_configuration{
#
  #}

  logging_configuration {
    dag_processing_logs {
      enabled   = true
      log_level = "INFO"
    }

    scheduler_logs {
      enabled   = true
      log_level = "INFO"
    }

    task_logs {
      enabled   = true
      log_level = "INFO"
    }

    webserver_logs {
      enabled   = true
      log_level = "INFO"
    }

    worker_logs {
      enabled   = true
      log_level = "INFO"
    }
  }

  tags = merge(
    local.common_tags,
    {
      "Name" = "${var.name}-${var.project}-mwaa-environment-${var.environment}"
    }
  )
}

All my variables are there.

I had not created my own network and mwaa was failing to communicate with docker. Closing this now,

For reference if anyone goes through this in the future please initialise your docker as below:

docker network create my-network
docker run
–rm -it
–network my-network
-p “127.0.0.1:4566:4566”
-p “127.0.0.1:4510-4559:4510-4559”
-p “127.0.0.1:53:53”
-p “127.0.0.1:53:53/udp”
-p “127.0.0.1:443:443”
-e MAIN_DOCKER_NETWORK=my-network
-e LOCALSTACK_API_KEY=${LOCALSTACK_API_KEY:-sOyI2dB0Q3}
-e DOCKER_HOST=unix:///var/run/docker.sock
-v “${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack”
-v “/var/run/docker.sock:/var/run/docker.sock”
localstack/localstack-pro