Forked from chrisguitarguy/evident_io_terraform.tf
Last active
March 27, 2019 18:00
-
-
Save slmingol/4f66a3e5ab1aad950864ac67e517b792 to your computer and use it in GitHub Desktop.
Terraform configuration for an Evident.io IAM Role
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
variable "evident_account" { | |
type = "string" | |
} | |
variable "evident_id" { | |
type = "string" | |
} | |
data "aws_iam_policy_document" "evident" { | |
statement { | |
sid = "AllowEvidentExternalAccess" | |
effect = "Allow" | |
actions = ["sts:AssumeRole"] | |
principals { | |
type = "AWS" | |
identifiers = ["arn:aws:iam::${var.evident_account}:root"] | |
} | |
condition { | |
test = "StringEquals" | |
variable = "sts:ExternalId" | |
values = ["${var.evident_id}"] | |
} | |
} | |
} | |
resource "aws_iam_role" "evident" { | |
name = "Evident-Service-Role" | |
assume_role_policy = "${data.aws_iam_policy_document.evident.json}" | |
} | |
resource "aws_iam_role_policy_attachment" "evident_security" { | |
role = "${aws_iam_role.evident.name}" | |
policy_arn = "arn:aws:iam::aws:policy/SecurityAudit" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The original that I forked had a typo, I've fixed that in this version of the gist.