module "etl_backfill_s3_rw_policy" {
  source       = "../../../modules/iam/policies/s3/buckets_rw"
  bucket_masks = ["*-delphi-sme-data-etl-backfill", "stage-sme-data-archive-temp", "sme-data-archive"]
  name         = "stage-etl-backfill"
  name_prefix  = local.name_prefix
}

module "etl_backfill_role" {
  source = "../../../modules/iam/roles/ec2_instance_role"

  name_prefix = local.name_prefix
  name        = "etl-backfill"

  common_tags = merge(
    local.common_tags,
    {
      project                  = "Infrastructure",
      service                  = "EC2",
      plat_env_project_service = "${local.aggregated_tag}_INFA_EC2"
    }
  )

  policies_list = [
    module.etl_backfill_s3_rw_policy.policy.arn
  ]
}

/* module etl_backfill_instance {
  source = "../../../modules/ec2/ec2"

  name_prefix     = "${local.name_prefix}-etl-backfill"
  instances_count = 1
  # amzn2-ami-ecs-hvm-2.0.20200115-x86_64-ebs
  ami                  = "ami-0947d2ba12ee1ff75"
  instance_type        = "t3.medium"
  use_public_ip        = true
  key_name             = "stage-delphi-default"
  security_groups      = [module.main_sg_map.management_id]
  subnet_ids           = [module.main_public_subnets.subnet_ids[1]]
  iam_instance_profile = module.etl_backfill_role.role.name
  root_volume_size     = 650

  common_tags = merge(
    local.common_tags,
    {
      project                  = "Infrastructure",
      service                  = "EC2",
      plat_env_project_service = "${local.aggregated_tag}_INFRA_EC2"
      os_platform              = "linux"
    }
  )
}
 */
