From 1556d1c63e834ef046acbe33739ec85858086627 Mon Sep 17 00:00:00 2001 From: Bill Young Date: Wed, 15 Jun 2016 12:58:44 -0400 Subject: [PATCH] Add IAM profiles for Kubernetes nodes --- .../terraform/aws/00-create-infrastructure.tf | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/contrib/terraform/aws/00-create-infrastructure.tf b/contrib/terraform/aws/00-create-infrastructure.tf index 12fcfd2ec..09cfac37c 100755 --- a/contrib/terraform/aws/00-create-infrastructure.tf +++ b/contrib/terraform/aws/00-create-infrastructure.tf @@ -81,6 +81,112 @@ provider "aws" { region = "${var.awsRegion}" } +variable "iam_prefix" { + type = "string" + description = "Prefix name for IAM profiles" +} + +resource "aws_iam_instance_profile" "kubernetes_master_profile" { + name = "${var.iam_prefix}_kubernetes_master_profile" + roles = ["${aws_iam_role.kubernetes_master_role.name}"] +} + +resource "aws_iam_role" "kubernetes_master_role" { + name = "${var.iam_prefix}_kubernetes_master_role" + assume_role_policy = <