Commit 33d00097 authored by Beckybrannan's avatar Beckybrannan

Temporarily commenting out & reconfiguring some resources for testing

parent c23c813a
......@@ -23,12 +23,12 @@ variable "admin" {
# IAM Role, Policy and Attachment
#############################################################################################################
data "template_file" "assume_role" {
template = "${file("${path.module}/assume_role.json")}"
vars {
source_account_id = "${var.source_account_id}"
}
}
# data "template_file" "assume_role" {
# template = "${file("${path.module}/assume_role.json")}"
# vars {
# source_account_id = "${var.source_account_id}"
# }
# }
# resource "aws_iam_role" "role" {
# count = terraform.required_version < "0.12.0" ? 1 : 0
......@@ -40,7 +40,7 @@ data "template_file" "assume_role" {
# lifecycle { create_before_destroy = true }
# }
resource "aws_iam_role" "role" {
count = terraform.required_version > "0.12.0" ? 1 : 0
count = var.terraform_version > "0.12.0" ? 1 : 0
name = "${var.name}"
assume_role_policy = templatefile("${path.module}/assume_role.json", { source_account_id = var.source_account_id })
tags = {
......@@ -58,13 +58,13 @@ resource "aws_iam_policy" "steamhaus_apn" {
}
resource "aws_iam_role_policy_attachment" "steamhaus_apn" {
role = "${aws_iam_role.role.name}"
policy_arn = "${aws_iam_policy.steamhaus_apn.arn}"
role = "${aws_iam_role.role[count.index].name}"
policy_arn = "${aws_iam_policy.steamhaus_apn[count.index].arn}"
count = "${var.steamhaus_apn}"
}
resource "aws_iam_role_policy_attachment" "admin" {
role = "${aws_iam_role.role.name}"
role = "${aws_iam_role.role[count.index].name}"
policy_arn = "arn:aws:iam::aws:policy/AdministratorAccess"
count = "${var.admin}"
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment