provider "aws" {
  region = var.aws_region
}

terraform {
  backend "s3" {
    bucket  = "dev-orcd-terraform-state"
    key     = "dev/dpinchukov/dd-fargate-python/terraform.tfstate"
    region  = "us-east-1"
    encrypt = "true"
  }
}

data "aws_caller_identity" "current" {}

module "fargate_environment" {
  source = "git@github.com:theorchard/terraform-fargate.git//?ref=1.7.10"

  environment                       = var.environment
  service_name                      = var.service_name
  aws_region                        = var.aws_region
  service_platform_version          = "1.4.0"
  desired_task_count                = 2
  minimum_capacity                  = 2
  maximum_capacity                  = 2
  task_cpu                          = 256
  task_memory                       = 512
  container_port                    = 8000
  blocking_waf_enabled              = true
  health_check_grace_period_seconds = 5
  health_check_path                 = "/healthcheck"
  vpc_id                            = "vpc-34dbfd51"

  environment_variables = [
    {
      DD_VERSION = 2
    }
  ]
}
