Commit 470c97e4 authored by drechsau's avatar drechsau

formatting

parent aae0b44f
......@@ -5,7 +5,7 @@ resource "aws_cloudwatch_metric_alarm" "drone_deploy_recovery" {
period = "60"
alarm_description = "This metric auto recovers EC2 instances"
alarm_actions = ["arn:aws:automate:${var.region}:ec2:recover"]
alarm_actions = ["arn:aws:automate:${var.region}:ec2:recover"]
statistic = "Minimum"
comparison_operator = "GreaterThanThreshold"
......@@ -16,4 +16,3 @@ resource "aws_cloudwatch_metric_alarm" "drone_deploy_recovery" {
InstanceId = "${aws_instance.drone_deploy_instance.id}"
}
}
......@@ -7,3 +7,14 @@ data "terraform_remote_state" "vpc" {
region = "us-east-2"
}
}
# RDS data we need
data "terraform_remote_state" "rds" {
backend = "s3"
config {
bucket = "geeks-terraform"
key = "drone-deploy/drone/rds/terraform.tfstate"
region = "us-east-2"
}
}
......@@ -8,45 +8,45 @@ resource "aws_security_group" "drone_deploy_inbound_sg" {
# ping from all
ingress {
from_port = -1
to_port = -1
protocol = "icmp"
cidr_blocks = ["0.0.0.0/0"]
from_port = -1
to_port = -1
protocol = "icmp"
cidr_blocks = ["0.0.0.0/0"]
ipv6_cidr_blocks = ["::/0"]
}
# access from home
ingress {
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["${var.mikeh-home}", "${var.mikeh-lab}"]
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["${var.mikeh-home}", "${var.mikeh-lab}"]
ipv6_cidr_blocks = ["${var.mikeh-home-ipv6}", "${var.mikeh-lab-ipv6}"]
}
# should make the ports a variable
ingress {
from_port = 9000
to_port = 9000
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
from_port = 9000
to_port = 9000
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
ipv6_cidr_blocks = ["::/0"]
}
ingress {
from_port = 2375
to_port = 2376
protocol = "tcp"
cidr_blocks = ["${var.mikeh-home}", "${var.mikeh-lab}"]
from_port = 2375
to_port = 2376
protocol = "tcp"
cidr_blocks = ["${var.mikeh-home}", "${var.mikeh-lab}"]
ipv6_cidr_blocks = ["${var.mikeh-home-ipv6}", "${var.mikeh-lab-ipv6}"]
}
# and we have outbound access to everything cause I'm k00l
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
ipv6_cidr_blocks = ["::/0"]
}
......
......@@ -13,11 +13,11 @@
#!# output "sn-efs-b" {
#!# value = "${aws_subnet.efs-b.id}"
#!# }
#!#
#!# output "sn-databases-b" {
#!# value = "${aws_subnet.databases-b.id}"
#!# }
#!#
output "sn-databases-b" {
value = "${aws_subnet.databases-b.id}"
}
#!# output "sn-elasticache-b" {
#!# value = "${aws_subnet.elasticache-b.id}"
#!# }
......
......@@ -13,11 +13,11 @@
#!# output "sn-efs-c" {
#!# value = "${aws_subnet.efs-c.id}"
#!# }
#!#
#!# output "sn-databases-c" {
#!# value = "${aws_subnet.databases-c.id}"
#!# }
#!#
output "sn-databases-c" {
value = "${aws_subnet.databases-c.id}"
}
#!# output "sn-elasticache-c" {
#!# value = "${aws_subnet.elasticache-c.id}"
#!# }
......
......@@ -37,8 +37,16 @@ output "cmgmt-ids" {
output "databases-subnets" {
value = [
"${aws_subnet.databases-a.id}",
#"${aws_subnet.databases-b.id}",
#"${aws_subnet.databases-c.id}",
"${aws_subnet.databases-b.id}",
"${aws_subnet.databases-c.id}",
]
}
output "databases-subnets-cidr" {
value = [
"${aws_subnet.databases-a.cidr_block}",
"${aws_subnet.databases-b.cidr_block}",
"${aws_subnet.databases-c.cidr_block}",
]
}
......
......@@ -43,21 +43,21 @@
#!# Name = "efs-b-${var.azs[1]}"
#!# }
#!# }
#!#
#!# resource "aws_subnet" "databases-b" {
#!# vpc_id = "${module.vpc.vpc_id}"
#!#
#!# cidr_block = "${var.first-2-octets}.49.0/24"
#!#
#!# availability_zone = "${var.azs[1]}"
#!#
#!# map_public_ip_on_launch = false
#!#
#!# tags {
#!# Name = "databases-b-${var.azs[1]}"
#!# }
#!# }
#!#
resource "aws_subnet" "databases-b" {
vpc_id = "${module.vpc.vpc_id}"
cidr_block = "${var.first-2-octets}.49.0/24"
availability_zone = "${var.azs[1]}"
map_public_ip_on_launch = false
tags {
Name = "databases-b-${var.azs[1]}"
}
}
#!# resource "aws_subnet" "elasticache-b" {
#!# vpc_id = "${module.vpc.vpc_id}"
#!#
......
......@@ -43,21 +43,21 @@
#!# Name = "efs-c-${var.azs[2]}"
#!# }
#!# }
#!#
#!# resource "aws_subnet" "databases-c" {
#!# vpc_id = "${module.vpc.vpc_id}"
#!#
#!# cidr_block = "${var.first-2-octets}.50.0/24"
#!#
#!# availability_zone = "${var.azs[2]}"
#!#
#!# map_public_ip_on_launch = false
#!#
#!# tags {
#!# Name = "databases-c-${var.azs[2]}"
#!# }
#!# }
#!#
resource "aws_subnet" "databases-c" {
vpc_id = "${module.vpc.vpc_id}"
cidr_block = "${var.first-2-octets}.50.0/24"
availability_zone = "${var.azs[2]}"
map_public_ip_on_launch = false
tags {
Name = "databases-c-${var.azs[2]}"
}
}
#!# resource "aws_subnet" "elasticache-c" {
#!# vpc_id = "${module.vpc.vpc_id}"
#!#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment