-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from buildo/5-update-to-terraform-0.12
#5: Update to terraform 0.12
- Loading branch information
Showing
5 changed files
with
66 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,34 @@ | ||
resource "aws_security_group" "sg" { | ||
name = "${var.project_name}" | ||
name = var.project_name | ||
} | ||
|
||
resource "aws_security_group_rule" "ssh" { | ||
type = "ingress" | ||
protocol = "tcp" | ||
security_group_id = "${aws_security_group.sg.id}" | ||
from_port = 22 | ||
to_port = 22 | ||
cidr_blocks = "${var.in_cidr_blocks}" | ||
type = "ingress" | ||
protocol = "tcp" | ||
security_group_id = aws_security_group.sg.id | ||
from_port = 22 | ||
to_port = 22 | ||
cidr_blocks = var.in_cidr_blocks | ||
} | ||
|
||
resource "aws_security_group_rule" "out_all" { | ||
type = "egress" | ||
protocol = -1 | ||
security_group_id = "${aws_security_group.sg.id}" | ||
from_port = 0 | ||
to_port = 0 | ||
cidr_blocks = ["0.0.0.0/0"] | ||
type = "egress" | ||
protocol = -1 | ||
security_group_id = aws_security_group.sg.id | ||
from_port = 0 | ||
to_port = 0 | ||
cidr_blocks = ["0.0.0.0/0"] | ||
} | ||
|
||
resource "aws_security_group_rule" "custom_ports" { | ||
count = "${length(var.in_open_ports)}" | ||
type = "ingress" | ||
protocol = "tcp" | ||
security_group_id = "${aws_security_group.sg.id}" | ||
from_port = "${2 == length(split("-", element(var.in_open_ports, count.index))) ? | ||
element(split("-", element(var.in_open_ports, count.index)), 0) : | ||
element(var.in_open_ports, count.index) }" | ||
to_port = "${2 == length(split("-", element(var.in_open_ports, count.index))) ? | ||
element(split("-", element(var.in_open_ports, count.index)), 1) : | ||
element(var.in_open_ports, count.index) }" | ||
cidr_blocks = "${var.in_cidr_blocks}" | ||
count = length(var.in_open_ports) | ||
type = "ingress" | ||
protocol = "tcp" | ||
security_group_id = aws_security_group.sg.id | ||
from_port = 2 == length(split("-", element(var.in_open_ports, count.index))) ? element(split("-", element(var.in_open_ports, count.index)), 0) : element(var.in_open_ports, count.index) | ||
|
||
to_port = 2 == length(split("-", element(var.in_open_ports, count.index))) ? element(split("-", element(var.in_open_ports, count.index)), 1) : element(var.in_open_ports, count.index) | ||
|
||
cidr_blocks = var.in_cidr_blocks | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,63 @@ | ||
variable project_name { | ||
variable "project_name" { | ||
description = "Project name, used for namespacing things" | ||
} | ||
|
||
variable instance_type { | ||
variable "instance_type" { | ||
default = "t2.micro" | ||
} | ||
|
||
variable ami { | ||
variable "ami" { | ||
description = "Custom AMI, if empty will use latest Ubuntu" | ||
default = "" | ||
} | ||
|
||
variable volume_size { | ||
variable "volume_size" { | ||
description = "Volume size" | ||
default = 8 | ||
} | ||
|
||
variable ssh_private_key { | ||
variable "ssh_private_key" { | ||
description = "Used to connect to the instance once created" | ||
} | ||
|
||
variable ssh_key_name { | ||
variable "ssh_key_name" { | ||
description = "Name of the key-pair on EC2 (aws-ireland, buildo-aws, ...)" | ||
} | ||
|
||
variable zone_id { | ||
variable "zone_id" { | ||
description = "Route53 Zone ID" | ||
} | ||
|
||
variable host_name { | ||
variable "host_name" { | ||
description = "DNS host name" | ||
} | ||
|
||
variable quay_password { | ||
variable "quay_password" { | ||
description = "Quay password" | ||
} | ||
|
||
variable init_script { | ||
description = "bash code executed before `crane lift` is called, example: `\"${file(\"init.sh\")}\"`" | ||
variable "init_script" { | ||
description = "bash code executed before `crane lift` is called, example: `\"$${file(\\\"init.sh\\\")}\"`" | ||
default = "" | ||
} | ||
|
||
variable in_open_ports { | ||
variable "in_open_ports" { | ||
default = [] | ||
} | ||
|
||
variable in_cidr_blocks { | ||
variable "in_cidr_blocks" { | ||
default = ["0.0.0.0/0"] | ||
} | ||
|
||
variable disk_utilization_alarm_threshold { | ||
variable "disk_utilization_alarm_threshold" { | ||
description = "disk occupation alarm threshold (% of disk utilization)" | ||
default = "80" | ||
} | ||
|
||
variable bellosguardo_target { | ||
variable "bellosguardo_target" { | ||
description = "Possible values are 'buildo', 'omnilab'" | ||
} | ||
|
||
variable iam_instance_profile { | ||
variable "iam_instance_profile" { | ||
default = "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
terraform { | ||
required_version = ">= 0.12" | ||
} |