Skip to content

Commit

Permalink
Added custom name support to KMS
Browse files Browse the repository at this point in the history
This allows you to use the custom naming for the IAM Role in the KMS module.
  • Loading branch information
Richard Genthner committed Jul 22, 2017
1 parent 21a2827 commit 57e02bf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ module "s3" {
name = "${var.cluster-name}"
bucketname = "${var.bucketname}"
worker-role = "${var.worker_role_name}"
master-role = "${var.master_role_name}"
capem = "${var.capem}"
cakey = "${var.cakey}"
etcdpem = "${var.etcdpem}"
Expand Down
4 changes: 2 additions & 2 deletions modules/s3/01-arngen.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ data "template_file" "kmspolicy" {
template = "${file("${path.module}/Files/kmspolicy.json.tpl")}"

vars {
arn = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/worker_role"
masterarn = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/master_role"
arn = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/${var.worker-role}"
masterarn = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/${var.master-role}"
rootarn = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:root"
}
}
2 changes: 2 additions & 0 deletions modules/s3/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ variable "bucketname" {}

variable "worker-role" {}

variable "master-role" {}

### Bucket objects

variable "capem" {}
Expand Down

0 comments on commit 57e02bf

Please sign in to comment.