Created
March 26, 2021 06:55
-
-
Save PrashantBhatasana/ca78f0b4082b666d87095cb20ef3e04f 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
resource "aws_iam_role" "inspector_event_role" { | |
name = "inspector-event-role-${var.random_id_prefix}" | |
assume_role_policy = <<EOF | |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": "sts:AssumeRole", | |
"Principal": { | |
"Service": "events.amazonaws.com" | |
}, | |
"Effect": "Allow", | |
"Sid": "" | |
} | |
] | |
} | |
EOF | |
} | |
data "aws_iam_policy_document" "inspector_event_role_policy" { | |
statement { | |
sid = "StartAssessment" | |
actions = [ | |
"inspector:StartAssessmentRun", | |
] | |
resources = [ | |
"*" | |
] | |
} | |
} | |
resource "aws_iam_role_policy" "inspector_event" { | |
name = "inspector-event-policy-${var.random_id_prefix}" | |
role = aws_iam_role.inspector_event_role.id | |
policy = data.aws_iam_policy_document.inspector_event_role_policy.json | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment