Skip to content

Instantly share code, notes, and snippets.

@slmingol
Forked from chrisguitarguy/evident_io_terraform.tf
Last active March 27, 2019 18:00
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 slmingol/4f66a3e5ab1aad950864ac67e517b792 to your computer and use it in GitHub Desktop.
Save slmingol/4f66a3e5ab1aad950864ac67e517b792 to your computer and use it in GitHub Desktop.
Terraform configuration for an Evident.io IAM Role
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"
}
@slmingol
Copy link
Author

The original that I forked had a typo, I've fixed that in this version of the gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment