-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade code to be terraform 0.12 compatible (#71)
* .Fix fixed outdated certificate * .Fix fixed missing ami problem * .Update use available ami for example * .Update switch to last pre terraform 12 consul module tag * .Update switch to consul 0.7.0 module * .Update upgrade consul example to tf 12 * .Update upgraded consul module to tf 12 * .Update upgrade bastion module to tf 12 * .Update upgrade networking to tf 12 * .Update upgrade nomad module to tf 12 * .Update removed unused consul_cluster_security_group_id * .Update added needed security groups to enable nomad to register at consul * .Update upgrade nomad-datacenter module to tf 12 * .Update upgrade ui-access module to tf 12 * .Update added changelog * .Update upgrade root-module to tf 12 * .Update changelog * .Fix used available variable instead of removed local * .Fix used available variable instead of removed local
- Loading branch information
1 parent
0e4dfbe
commit b1a81f9
Showing
89 changed files
with
1,241 additions
and
952 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Changelog | ||
|
||
## v0.2.0 (2019-??-??) | ||
|
||
- **major (incompatible)**, Refactor: With [#70](https://github.com/MatthiasScholz/cos/issues/70) the cos module was upgraded to be compatible to terraform 0.12.0. | ||
- Furthermore the depending modules where upgraded as well: | ||
- terraform-aws-consul from [v0.3.1](https://github.com/hashicorp/terraform-aws-consul/tree/v0.3.1) to [v0.7.0](https://github.com/hashicorp/terraform-aws-consul/tree/v0.7.0) | ||
- terraform-aws-nomad from [v0.4.5](https://github.com/hashicorp/terraform-aws-nomad/tree/v0.4.5) to [v0.5.0](https://github.com/hashicorp/terraform-aws-nomad/tree/v0.5.0) | ||
- License: With [9156e49](https://github.com/MatthiasScholz/cos/commit/9156e49f0eabbfc50100aeb778e6a776ba376b96) the license model was changed from GPL to LGPL, a more relaxed one. | ||
- Test: With PR [#68](https://github.com/MatthiasScholz/cos/pull/68) tests (terratest) where added to ensure functionality of the COS. | ||
|
||
## v0.1.1 (2019-07-20) | ||
|
||
## v0.1.0 (2019-06-14) | ||
|
||
## v0.0.3 (2019-01-01) | ||
|
||
## v0.0.2 (2018-12-13) | ||
|
||
## v0.0.1 (2018-04-30) |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
terraform { | ||
required_version = ">= 0.12" | ||
} |
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,15 +1,15 @@ | ||
output "asg_name_consul_servers" { | ||
value = "${module.consul.asg_name_consul_servers}" | ||
value = module.consul.asg_name_consul_servers | ||
} | ||
|
||
output "security_group_id_consul_servers" { | ||
value = "${module.consul.security_group_id_consul_servers}" | ||
value = module.consul.security_group_id_consul_servers | ||
} | ||
|
||
output "consul_servers_cluster_tag_key" { | ||
value = "${module.consul.consul_servers_cluster_tag_key}" | ||
value = module.consul.consul_servers_cluster_tag_key | ||
} | ||
|
||
output "consul_servers_cluster_tag_value" { | ||
value = "${module.consul.consul_servers_cluster_tag_value}" | ||
value = module.consul.consul_servers_cluster_tag_value | ||
} |
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" | ||
} |
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,9 +1,9 @@ | ||
provider "aws" { | ||
profile = "${var.deploy_profile}" | ||
region = "${var.aws_region}" | ||
profile = var.deploy_profile | ||
region = var.aws_region | ||
} | ||
|
||
module "networking" { | ||
source = "../../modules/networking" | ||
region = "${var.aws_region}" | ||
region = var.aws_region | ||
} |
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" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
terraform { | ||
required_version = ">= 0.12" | ||
} |
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,15 +1,16 @@ | ||
output "aws_region" { | ||
value = "${var.aws_region}" | ||
value = var.aws_region | ||
} | ||
|
||
output "nomad_servers_cluster_tag_key" { | ||
value = "${module.nomad.nomad_servers_cluster_tag_key}" | ||
value = module.nomad.nomad_servers_cluster_tag_key | ||
} | ||
|
||
output "nomad_servers_cluster_tag_value" { | ||
value = "${module.nomad.nomad_servers_cluster_tag_value}" | ||
value = module.nomad.nomad_servers_cluster_tag_value | ||
} | ||
|
||
output "num_nomad_servers" { | ||
value = "${module.nomad.num_nomad_servers}" | ||
value = module.nomad.num_nomad_servers | ||
} | ||
|
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,26 @@ | ||
locals { | ||
# The rule_map contains the spec for the security group rules that should be applied. | ||
# An entry is of the form "<description>" = ["<protocol>",<from_port>,<to_port>] | ||
rule_map = { | ||
"Grants access from nomad (rcp, serf: lan, wan - tcp)" = ["tcp",8300,8302], | ||
"Grants access from nomad (rcp, serf: lan, wan - udp)" = ["udp",8301,8302], | ||
"Grants access from nomad (http)" = ["tcp",8500,8500], | ||
"Grants access from nomad (dns tcp)" = ["tcp",8600,8600], | ||
"Grants access from nomad (dns udp)" = ["udp",8600,8600], | ||
} | ||
} | ||
|
||
# rule granting access from nomad to consul on ports defined in rule_map | ||
# [nomad>consul] | ||
resource "aws_security_group_rule" "sgr_nomad_to_consul" { | ||
|
||
for_each = local.rule_map | ||
|
||
type = "ingress" | ||
description = each.key | ||
protocol = element(each.value,0) | ||
from_port = element(each.value,1) | ||
to_port = element(each.value,2) | ||
source_security_group_id = module.nomad.security_group_id_nomad_servers | ||
security_group_id = module.consul.security_group_id_consul_servers | ||
} |
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,18 @@ | ||
locals { | ||
protocols = ["tcp","udp"] | ||
} | ||
|
||
# rule granting access from consul to nomad server on ports | ||
# 8300...8302 tcp and udp | ||
# [consul>nomad] RCP, Serf LAN and WAN, TCP + UDP | ||
resource "aws_security_group_rule" "sgr_consul_to_nomad_server" { | ||
count = length(local.protocols) | ||
|
||
type = "ingress" | ||
description = "Grants access from consul server (rcp, serf: lan, wan - ${element(local.protocols,count.index)})" | ||
from_port = 8300 | ||
to_port = 8302 | ||
protocol = element(local.protocols,count.index) | ||
source_security_group_id = module.consul.security_group_id_consul_servers | ||
security_group_id = module.nomad.security_group_id_nomad_servers | ||
} |
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
Oops, something went wrong.