Created
April 28, 2018 19:51
-
-
Save cloudyparts/f7a80e940cf9648eb815bca6a0d43788 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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