data "aws_iam_policy_document" "battery-studios-archive" {
  statement {
    sid    = "Stmt1575654931857"
    effect = "Allow"

    resources = [
      "arn:aws:s3:::battery-studios-archive/*",
      "arn:aws:s3:::battery-studios-archive",
    ]

    actions = [
      "s3:DeleteObject",
      "s3:GetObject",
      "s3:ListBucket",
      "s3:PutObject",
      "s3:RestoreObject",
    ]

    principals {
      type        = "AWS"
      identifiers = ["arn:aws:iam::793676410512:user/gmpp-battery-studios-admin"]
    }
  }

  statement {
    sid    = "Stmt1575655002102"
    effect = "Allow"

    resources = [
      "arn:aws:s3:::battery-studios-archive/*",
      "arn:aws:s3:::battery-studios-archive",
    ]

    actions = [
      "s3:GetObject",
      "s3:ListBucket",
      "s3:PutObject",
      "s3:RestoreObject",
    ]

    principals {
      type        = "AWS"
      identifiers = ["arn:aws:iam::793676410512:user/gmpp-battery-studios-engg"]
    }
  }

  statement {
    sid    = "Stmt1575655002101"
    effect = "Allow"

    resources = [
      "arn:aws:s3:::battery-studios-archive/*",
      "arn:aws:s3:::battery-studios-archive",
    ]

    actions = ["s3:*"]

    principals {
      type = "AWS"
      identifiers = [
        "arn:aws:iam::793676410512:role/s3-full-access",
        "arn:aws:iam::554998489284:user/da-s3-importer-prod",
        "arn:aws:iam::554998489284:role/da-batch-initiator-prod-role",
        "arn:aws:iam::887829410671:role/da-batch-initiator-stage-role"
      ]
    }
  }

  statement {
    sid    = "Stmt1575655003100"
    effect = "Allow"

    resources = [
      "arn:aws:s3:::battery-studios-archive/*",
      "arn:aws:s3:::battery-studios-archive",
    ]

    actions = [
      "s3:GetObject",
      "s3:ListBucket",
      "s3:PutObject",
      "s3:RestoreObject",
    ]

    principals {
      type = "AWS"
      identifiers = [
        "arn:aws:iam::887829410671:user/da-s3-importer",
        "arn:aws:iam::887829410671:user/da-s3-importer-stage"
      ]
    }
  }

  statement {
    sid       = ""
    effect    = "Deny"
    resources = ["arn:aws:s3:::battery-studios-archive/*"]
    actions   = ["*"]

    condition {
      test     = "Bool"
      variable = "aws:SecureTransport"
      values   = ["false"]
    }

    principals {
      type        = "*"
      identifiers = ["*"]
    }
  }
}

data "aws_iam_policy_document" "battery-studios-archive-replica" {
  statement {
    sid    = "Stmt1575655002101"
    effect = "Allow"

    resources = [
      "arn:aws:s3:::battery-studios-archive-replica/*",
      "arn:aws:s3:::battery-studios-archive-replica",
    ]

    actions = ["s3:*"]

    principals {
      type        = "AWS"
      identifiers = ["arn:aws:iam::793676410512:role/s3-full-access"]
    }
  }

  statement {
    sid       = ""
    effect    = "Deny"
    resources = ["arn:aws:s3:::battery-studios-archive-replica/*"]
    actions   = ["*"]

    condition {
      test     = "Bool"
      variable = "aws:SecureTransport"
      values   = ["false"]
    }

    principals {
      type        = "*"
      identifiers = ["*"]
    }
  }
}

data "aws_iam_policy_document" "sme-aoma-gmp-prod" {
  statement {
    sid    = "Stmt1540357096339"
    effect = "Allow"

    resources = [
      "arn:aws:s3:::sme-aoma-gmp-prod",
      "arn:aws:s3:::sme-aoma-gmp-prod/*",
    ]

    actions = ["s3:*"]

    principals {
      type = "AWS"
      identifiers = [
        "arn:aws:iam::793676410512:user/gmpp-archive",
        "arn:aws:iam::554998489284:user/da-s3-importer-prod"
      ]
    }
  }

  statement {
    sid       = ""
    effect    = "Deny"
    resources = ["arn:aws:s3:::sme-aoma-gmp-prod/*"]
    actions   = ["*"]

    condition {
      test     = "Bool"
      variable = "aws:SecureTransport"
      values   = ["false"]
    }

    principals {
      type        = "*"
      identifiers = ["*"]
    }
  }
}

data "aws_iam_policy_document" "sme-aoma-gmp-prod-archive" {
  statement {
    sid    = "Stmt1629294150512"
    effect = "Allow"

    resources = [
      "arn:aws:s3:::sme-aoma-gmp-prod-archive",
      "arn:aws:s3:::sme-aoma-gmp-prod-archive/*",
    ]

    actions = ["s3:*"]

    principals {
      type        = "AWS"
      identifiers = ["arn:aws:iam::793676410512:user/gmpp-archive"]
    }
  }

  statement {
    sid       = ""
    effect    = "Deny"
    resources = ["arn:aws:s3:::sme-aoma-gmp-prod-archive/*"]
    actions   = ["*"]

    condition {
      test     = "Bool"
      variable = "aws:SecureTransport"
      values   = ["false"]
    }

    principals {
      type        = "*"
      identifiers = ["*"]
    }
  }
}

data "aws_iam_policy_document" "sme-aoma-gmp-prod-athena-out" {
  statement {
    sid       = ""
    effect    = "Deny"
    resources = ["arn:aws:s3:::sme-aoma-gmp-prod-athena-out/*"]
    actions   = ["*"]

    condition {
      test     = "Bool"
      variable = "aws:SecureTransport"
      values   = ["false"]
    }

    principals {
      type        = "*"
      identifiers = ["*"]
    }
  }
}

data "aws_iam_policy_document" "sme-aoma-gmp-prod-awsconfig" {
  statement {
    sid       = ""
    effect    = "Allow"
    resources = ["arn:aws:s3:::sme-aoma-gmp-prod-awsconfig/*"]
    actions   = ["s3:GetObject"]

    principals {
      type        = "AWS"
      identifiers = ["arn:aws:iam::797906716436:root"]
    }
  }

  statement {
    sid       = ""
    effect    = "Allow"
    resources = ["arn:aws:s3:::sme-aoma-gmp-prod-awsconfig"]
    actions   = ["s3:ListBucket"]

    principals {
      type        = "AWS"
      identifiers = ["arn:aws:iam::797906716436:root"]
    }
  }

  statement {
    sid       = ""
    effect    = "Deny"
    resources = ["arn:aws:s3:::sme-aoma-gmp-prod-awsconfig/*"]
    actions   = ["*"]

    condition {
      test     = "Bool"
      variable = "aws:SecureTransport"
      values   = ["false"]
    }

    principals {
      type        = "*"
      identifiers = ["*"]
    }
  }
}

data "aws_iam_policy_document" "sme-aoma-gmp-prod-eu-central-1-logs" {
  statement {
    sid       = ""
    effect    = "Deny"
    resources = ["arn:aws:s3:::sme-aoma-gmp-prod-eu-central-1-logs/*"]
    actions   = ["*"]

    condition {
      test     = "Bool"
      variable = "aws:SecureTransport"
      values   = ["false"]
    }

    principals {
      type        = "*"
      identifiers = ["*"]
    }
  }
}

data "aws_iam_policy_document" "sme-aoma-gmp-prod-euc1-s3-inventory" {
  statement {
    sid       = "S3PolicyStmt-DO-NOT-MODIFY-1603804496875"
    effect    = "Allow"
    resources = ["arn:aws:s3:::sme-aoma-gmp-prod-euc1-s3-inventory/*"]
    actions   = ["s3:PutObject"]

    condition {
      test     = "StringEquals"
      variable = "s3:x-amz-acl"
      values   = ["bucket-owner-full-control"]
    }

    condition {
      test     = "StringEquals"
      variable = "aws:SourceAccount"
      values   = ["793676410512"]
    }

    condition {
      test     = "ArnLike"
      variable = "aws:SourceArn"
      values   = ["arn:aws:s3:::*"]
    }

    principals {
      type        = "Service"
      identifiers = ["s3.amazonaws.com"]
    }
  }

  statement {
    sid       = ""
    effect    = "Deny"
    resources = ["arn:aws:s3:::sme-aoma-gmp-prod-euc1-s3-inventory/*"]
    actions   = ["*"]

    condition {
      test     = "Bool"
      variable = "aws:SecureTransport"
      values   = ["false"]
    }

    principals {
      type        = "*"
      identifiers = ["*"]
    }
  }
}

data "aws_iam_policy_document" "sme-aoma-gmp-prod-rrd" {
  statement {
    sid    = "Stmt1625717745052"
    effect = "Allow"

    resources = [
      "arn:aws:s3:::sme-aoma-gmp-prod-rrd",
      "arn:aws:s3:::sme-aoma-gmp-prod-rrd/*",
    ]

    actions = ["s3:*"]

    principals {
      type = "AWS"
      identifiers = [
        "arn:aws:iam::793676410512:user/gmpp-rrd-admin",
        "arn:aws:iam::887829410671:role/da-batch-initiator-stage-role",
        "arn:aws:iam::554998489284:role/da-batch-initiator-prod-role",
      ]
    }
  }

  statement {
    sid       = ""
    effect    = "Deny"
    resources = ["arn:aws:s3:::sme-aoma-gmp-prod-rrd/*"]
    actions   = ["*"]

    condition {
      test     = "Bool"
      variable = "aws:SecureTransport"
      values   = ["false"]
    }

    principals {
      type        = "*"
      identifiers = ["*"]
    }
  }
}

data "aws_iam_policy_document" "sme-aoma-gmp-prod-us-east-1-logs" {
  statement {
    sid       = ""
    effect    = "Deny"
    resources = ["arn:aws:s3:::sme-aoma-gmp-prod-us-east-1-logs/*"]
    actions   = ["*"]

    condition {
      test     = "Bool"
      variable = "aws:SecureTransport"
      values   = ["false"]
    }

    principals {
      type        = "*"
      identifiers = ["*"]
    }
  }

  statement {
    sid     = "S3PolicyStmt-DO-NOT-MODIFY-1759738865238"
    effect  = "Allow"
    actions = ["s3:PutObject"]

    principals {
      type        = "Service"
      identifiers = ["logging.s3.amazonaws.com"]
    }

    resources = ["arn:aws:s3:::sme-aoma-gmp-prod-us-east-1-logs/*"]

    condition {
      test     = "StringEquals"
      variable = "aws:SourceAccount"
      values   = ["793676410512"]
    }
  }
}

data "aws_iam_policy_document" "sme-aoma-gmp-prod-use1-s3-inventory" {
  statement {
    sid       = "S3PolicyStmt-DO-NOT-MODIFY-1603804496875"
    effect    = "Allow"
    resources = ["arn:aws:s3:::sme-aoma-gmp-prod-use1-s3-inventory/*"]
    actions   = ["s3:PutObject"]

    condition {
      test     = "StringEquals"
      variable = "aws:SourceAccount"
      values   = ["793676410512"]
    }

    condition {
      test     = "StringEquals"
      variable = "s3:x-amz-acl"
      values   = ["bucket-owner-full-control"]
    }

    condition {
      test     = "ArnLike"
      variable = "aws:SourceArn"
      values   = ["arn:aws:s3:::*"]
    }

    principals {
      type        = "Service"
      identifiers = ["s3.amazonaws.com"]
    }
  }

  statement {
    sid       = ""
    effect    = "Deny"
    resources = ["arn:aws:s3:::sme-aoma-gmp-prod-use1-s3-inventory/*"]
    actions   = ["*"]

    condition {
      test     = "Bool"
      variable = "aws:SecureTransport"
      values   = ["false"]
    }

    principals {
      type        = "*"
      identifiers = ["*"]
    }
  }
}

data "aws_iam_policy_document" "gmp-spe-video-processing-01" {
  statement {
    sid    = "Stmt1575654931857"
    effect = "Allow"

    resources = [
      "arn:aws:s3:::gmp-spe-video-processing-01/*",
      "arn:aws:s3:::gmp-spe-video-processing-01",
    ]

    actions = [
      "s3:DeleteObject",
      "s3:GetObject",
      "s3:ListBucket",
      "s3:PutObject",
      "s3:RestoreObject",
    ]

    principals {
      type        = "AWS"
      identifiers = ["arn:aws:iam::793676410512:user/gmp-spe-video-processor"]
    }
  }
}
