Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Removes duplicate variable declarations in terraform
Browse files Browse the repository at this point in the history
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
  • Loading branch information
JoshVanL committed Jan 15, 2019
1 parent 423a13e commit db18013
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 31 deletions.
5 changes: 0 additions & 5 deletions terraform/amazon/modules/bastion/bastion_iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,3 @@ resource "aws_iam_role_policy_attachment" "bastion_tagging_control_lambda_invoke
role = "${aws_iam_role.bastion.name}"
policy_arn = "${var.tagging_control_policy_arn}"
}

resource "aws_iam_role_policy_attachment" "bastion_wing_binary_read" {
role = "${aws_iam_role.bastion.name}"
policy_arn = "${aws_iam_policy.wing_binary_read.arn}"
}
2 changes: 0 additions & 2 deletions terraform/amazon/modules/jenkins/inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,3 @@ variable "jenkins_admin_cidrs" {

variable "tagging_control_policy_arn" {}
variable "wing_binary_read_policy_arn" {}

variable "secrets_bucket" {}
1 change: 0 additions & 1 deletion terraform/amazon/modules/kubernetes/inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,5 @@ variable "elb_access_logs_internal_bucket_interval" {}

variable "backups_bucket" {}

variable "wing_binary_read_policy_arn" {}
variable "tagging_control_policy_arn" {}
variable "wing_binary_read_policy_arn" {}
1 change: 0 additions & 1 deletion terraform/amazon/modules/vault/inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,3 @@ locals {

variable "wing_binary_read_policy_arn" {}
variable "tagging_control_policy_arn" {}
variable "wing_binary_read_policy_arn" {}
14 changes: 3 additions & 11 deletions terraform/amazon/modules/vault/vault_iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,8 @@ resource "aws_iam_role_policy_attachment" "vault_wing_binary_read" {
count = "${var.vault_min_instance_count}"
}

resource "aws_iam_policy_attachment" "vault_tagging_control_lambda_invoke" {
name = "${data.template_file.stack_name.rendered}-tagging-control-lambda-invoke"
roles = ["${aws_iam_role.vault.*.name}"]
resource "aws_iam_role_policy_attachment" "vault_tagging_control_lambda_invoke" {
role = "${element(aws_iam_role.vault.*.name, count.index)}"
policy_arn = "${var.tagging_control_policy_arn}"
count = "${length(var.vault_iam_additional_policy_arns)}"
}

resource "aws_iam_policy_attachment" "vault_wing_binary_read" {
name = "${data.template_file.stack_name.rendered}-wing-binary-read"
roles = ["${aws_iam_role.vault.*.name}"]
policy_arn = "${var.wing_binary_read_policy_arn}"
count = "${length(var.vault_iam_additional_policy_arns)}"
count = "${var.vault_min_instance_count}"
}
7 changes: 0 additions & 7 deletions terraform/amazon/templates/modules.tf.template
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,8 @@ module "kubernetes" {
elb_access_logs_internal_bucket_prefix = "${var.elb_access_logs_internal_bucket_prefix}"
elb_access_logs_internal_bucket_interval = "${var.elb_access_logs_internal_bucket_interval}"

<<<<<<< HEAD
wing_binary_read_policy_arn = "${module.bastion.wing_binary_read_policy_arn}"
tagging_control_policy_arn = "${module.tagging_control.tagging_control_policy_arn}"
=======
tagging_control_policy_arn = "${module.tagging_control.tagging_control_policy_arn}"
wing_binary_read_policy_arn = "${module.bastion.wing_binary_read_policy_arn}"
>>>>>>> Share wing binary read policy across roles in terraform
}
{{- end -}}

Expand Down Expand Up @@ -293,7 +288,5 @@ module "kubernetes" {
elb_access_logs_internal_bucket = "${var.elb_access_logs_internal_bucket}"
elb_access_logs_internal_bucket_prefix = "${var.elb_access_logs_internal_bucket_prefix}"
elb_access_logs_internal_bucket_interval = "${var.elb_access_logs_internal_bucket_interval}"

wing_binary_read_policy_arn = "${data.terraform_remote_state.hub_state.bastion_bastion_wing_binary_read_policy_arn}"
}
{{- end }}
4 changes: 0 additions & 4 deletions terraform/amazon/templates/outputs.tf.template
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ output "tagging_control_tagging_control_policy_arn" {
value = "${module.tagging_control.tagging_control_policy_arn}"
}

output "bastion_bastion_wing_binary_read_policy_arn" {
value = "${module.bastion.wing_binary_read_policy_arn}"
}

output "instance_fqdns" {
value = ["${module.vault.instance_fqdns}"]
}
Expand Down

0 comments on commit db18013

Please sign in to comment.