resource "aws_efs_file_system" "sentry" {
  creation_token = "${local.name_prefix}-sentry"

  tags = merge(
    local.sentry_tags,
    {
      Name                     = "${local.name_prefix}-sentry"
      service                  = "EFS",
      plat_env_project_service = "${local.aggregated_tag}_SNTR_EFS"
    }
  )
}

resource "aws_efs_mount_target" "sentry" {
  count = length(data.aws_subnets.public_subnets.ids)

  file_system_id  = aws_efs_file_system.sentry.id
  security_groups = [data.aws_security_group.efs.id]
  subnet_id       = data.aws_subnets.public_subnets.ids[count.index]
}
