Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions ranger/ranger_aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ resource "aws_security_group" "rds_sg" {
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
tags {

tags = {
Name = "${var.rds_sg_name}"
}
}
Expand Down Expand Up @@ -72,7 +73,7 @@ resource "aws_security_group" "ec2_sg" {
from_port = "${var.ranger_port}"
to_port = "${var.ranger_port}"
protocol = "tcp"
cidr_blocks = ["${var.local_ips}"]
cidr_blocks = "${var.local_ips}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sandeepdabade I just saw this PR. Can you also look at the other open PR and let me know if you still want this to patched in?

}

ingress {
Expand All @@ -86,7 +87,7 @@ resource "aws_security_group" "ec2_sg" {
from_port = "${var.solr_port}"
to_port = "${var.solr_port}"
protocol = "tcp"
cidr_blocks = ["${var.local_ips}"]
cidr_blocks = "${var.local_ips}"
}

ingress {
Expand All @@ -100,7 +101,7 @@ resource "aws_security_group" "ec2_sg" {
from_port = "${var.ssh_port}"
to_port = "${var.ssh_port}"
protocol = "tcp"
cidr_blocks = ["${var.local_ips}"]
cidr_blocks = "${var.local_ips}"
}

# Allow all outbound traffic.
Expand All @@ -110,7 +111,7 @@ resource "aws_security_group" "ec2_sg" {
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
tags {
tags = {
Name = "${var.ranger_admin_sg_name}"
}
}
Expand All @@ -129,7 +130,7 @@ data "aws_vpc" "selected" {
data "template_file" "ranger_tmpl" {
template = "${file("ranger_install.sh.tpl")}"

vars {
vars = {
db_host = "${aws_db_instance.ranger_mysql.address}"
db_root_user = "${var.db_user}"
db_ranger_user = "${var.db_ranger_user}"
Expand All @@ -145,7 +146,7 @@ data "template_file" "ranger_tmpl" {
data "template_file" "solr_tmpl" {
template = "${file("solr_install.sh.tpl")}"

vars {
vars = {
solr_download_url = "${var.solr_download_url}"
}
}
Expand All @@ -159,7 +160,7 @@ resource "aws_instance" "tf_ranger_solr" {
subnet_id = "${var.public_subnets[0]}"
security_groups = ["${aws_security_group.ec2_sg.id}"]

tags {
tags = {
Name = "${var.ranger_solr_name}"
}

Expand All @@ -177,7 +178,7 @@ resource "aws_instance" "tf_ranger_admin" {
security_groups = ["${aws_security_group.ec2_sg.id}"]
depends_on = ["aws_db_instance.ranger_mysql"]

tags {
tags = {
Name="${format("${var.ranger_admin_name}-%01d",count.index+1)}"
}

Expand All @@ -203,7 +204,7 @@ resource "aws_security_group" "lb_sg" {
from_port = "${var.ranger_port}"
to_port = "${var.ranger_port}"
protocol = "tcp"
cidr_blocks = ["${var.local_ips}"]
cidr_blocks = "${var.local_ips}"
}

# Allow all outbound traffic.
Expand All @@ -213,7 +214,7 @@ resource "aws_security_group" "lb_sg" {
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
tags {
tags = {
Name = "${var.ranger_lb_sg_name}"
}
}
Expand Down Expand Up @@ -271,6 +272,7 @@ resource "aws_lb_listener" "lb_listener" {

#Instance Attachment
resource "aws_lb_target_group_attachment" "tg_attachment" {
count="${var.instance_count}"
target_group_arn = "${aws_lb_target_group.ranger_target.arn}"
target_id = "${element(aws_instance.tf_ranger_admin.*.id,count.index)}"
port = "${var.ranger_port}"
Expand Down