Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cloudyparts/f7a80e940cf9648eb815bca6a0d43788 to your computer and use it in GitHub Desktop.
Save cloudyparts/f7a80e940cf9648eb815bca6a0d43788 to your computer and use it in GitHub Desktop.
const testAccGuardDutyDetectorConfigBasic = `
// ##################################################
// create the role trust policy
data "aws_iam_policy_document" "trust" {
statement {
effect = "Allow"
actions = ["sts:AssumeRole"]
principals {
type = "Service"
identifiers = ["glue.amazonaws.com"]
}
}
}
// ##################################################
// create the Glue service-role
resource "aws_iam_role" "glue" {
name = "AWSGlueServiceRoleDefault"
path = "/service-role/"
assume_role_policy = "${ data.aws_iam_policy_document.trust.json }"
}
// ##################################################
// attach AWS managed Glue policy to Glue service-role
resource "aws_iam_role_policy_attachment" "aws-glue-service-role-default-policy-attachment" {
policy_arn = "arn:aws:iam::aws:policy/service-role/AWSGlueServiceRole"
role = "${aws_iam_role.glue.name}"
}
// ##################################################
// test glue catalog crawler
resource "aws_glue_catalog_crawler" "test" {
name = "test"
database_name = "db_name"
role = "${aws_iam_role.glue.name}"
s3_target {
path = "s3://bucket"
}
}
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment