This template sets up a Glue resource policy allowing the creation of tables across all Glue resources in the specified AWS account and region.

Terraform Template

data "aws_caller_identity" "current" {
}

data "aws_iam_policy_document" "glue-example-policy" {

  statement {
    actions = ["glue:CreateTable"]

    principals {
      identifiers = [*]
      type = "AWS"
    }
    resources = ["arn:${data.aws_partition.current.partition}:glue:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:*"]
  }
}

data "aws_partition" "current" {
}

data "aws_region" "current" {
}

resource "aws_glue_resource_policy" "example" {
  policy = data.aws_iam_policy_document.glue-example-policy.json
}