Skip to content

Instantly share code, notes, and snippets.

@zerolaser
Created October 27, 2016 10:18
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 zerolaser/67eb183c1a8a0d87fcd6a1fc67425d75 to your computer and use it in GitHub Desktop.
Save zerolaser/67eb183c1a8a0d87fcd6a1fc67425d75 to your computer and use it in GitHub Desktop.
variable "group_name" {
type = "string"
description ="Name of the IAM group"
}
variable "iam_path" {
type = "string"
default = "/"
description = "path where you want to create the IAM resource"
}
variable "policy_arn" {
description = "The ARN of the policy you want to apply"
type = "map"
default = {
EC2Access = "arn:aws:iam::aws:policy/AmazonEC2FullAccess"
ReadOnlyAccess = "arn:aws:iam::aws:policy/ReadOnlyAccess"
}
}
module "app_testing" {
source = "../../../modules/group/"
group_name = "${var.group_name}"
iam_path = "${var.iam_path}"
}
module "EC2Access_policy" {
source = "../../../modules/group_policy_attachment"
group_name = "${module.app_testing.group_name}"
policy_arn = "${lookup(var.policy_arn,"EC2Access")}"
}
module "ReadOnlyAccess_policy" {
source = "../../../modules/group_policy_attachment"
group_name = "${module.app_testing.group_name}"
policy_arn = "${lookup(var.policy_arn,"ReadOnlyAccess")}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment