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

Commit

Permalink
modules: remove deprecated data.aws_region.current parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
kerscher committed Apr 16, 2018
1 parent b9932c9 commit bfe0345
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 22 deletions.
4 changes: 1 addition & 3 deletions modules/cloudtrail/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ resource "aws_s3_bucket" "cloudtrail" {
tags = "${merge(map("Name", "${var.name_prefix}-cloudtrail"), "${var.extra_tags}")}"
}

data "aws_region" "current" {
current = true
}
data "aws_region" "current" {}

data "aws_iam_policy_document" "cloudtrail-bucket" {
statement {
Expand Down
4 changes: 1 addition & 3 deletions modules/cloudwatch-auto-recover-existing-ec2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
*
*/

data "aws_region" "current" {
current = true
}
data "aws_region" "current" {}

resource "aws_cloudwatch_metric_alarm" "auto-recover" {
count = "${length(compact(var.ec2_instance_ids))}"
Expand Down
4 changes: 1 addition & 3 deletions modules/credstash-setup/data.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
data "aws_caller_identity" "current" {}

data "aws_region" "current" {
current = true
}
data "aws_region" "current" {}

data "template_file" "credstash-get-cmd" {
template = "env credstash -r ${data.aws_region.current.name} -t ${var.db_table_name} get"
Expand Down
4 changes: 1 addition & 3 deletions modules/dnsmasq-server/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ resource "null_resource" "dnsmasq" {
}

# Current AWS region
data "aws_region" "current" {
current = true
}
data "aws_region" "current" {}

# Cloudwatch alarm that recovers the instance after two minutes of system status
# check failure
Expand Down
4 changes: 1 addition & 3 deletions modules/ec2-auto-recover-instances/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ resource "aws_instance" "auto-recover" {
}

# Current AWS region
data "aws_region" "current" {
current = true
}
data "aws_region" "current" {}

# Cloudwatch alarm that recovers the instance after two minutes of system status
# check failure
Expand Down
7 changes: 3 additions & 4 deletions modules/elasticsearch/master-nodes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ module "master-node-ebs-volumes" {
}
}

data "aws_region" "current" {
current = true
}
data "aws_region" "current" {}

resource "aws_iam_role_policy_attachment" "master-node-attach-ebs-volume" {
count = "${var.master_node_count}"
Expand Down Expand Up @@ -129,7 +127,8 @@ data "template_file" "master-node-config" {
security_groups = "[${aws_security_group.transport-sg.id}, ${aws_security_group.elasticsearch-api-sg.id}]"
availability_zones = "[${join(",", data.aws_subnet.private.*.availability_zone)}]"
cluster_tag = "${var.name_prefix}-elasticsearch-cluster"
extra_config = <<EXTRA_CONFIG

extra_config = <<EXTRA_CONFIG
# Only set the region for Elasticsearch 5.x, since it is deprecated in 6.x
${element(split(".", var.elasticsearch_version), 0) < 6 ? "cloud.aws.region: ${data.aws_region.current.name}" : ""}

Expand Down
4 changes: 1 addition & 3 deletions modules/persistent-ebs-volumes/iam.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
data "aws_caller_identity" "current" {}

data "aws_region" "current" {
current = true
}
data "aws_region" "current" {}

resource "aws_iam_policy" "ebs-volume-policy" {
count = "${var.volume_count}"
Expand Down

0 comments on commit bfe0345

Please sign in to comment.