Created
October 27, 2016 10:18
-
-
Save zerolaser/67eb183c1a8a0d87fcd6a1fc67425d75 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
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