-
Notifications
You must be signed in to change notification settings - Fork 105
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 #603 from Capgemini/594-aws-public-terraform-coreos
#594 - add terraform scripts for AWS private VPC with coreOS
- Loading branch information
Showing
45 changed files
with
591 additions
and
650 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,13 @@ | ||
#!/bin/bash | ||
|
||
export TF_VAR_access_key=${TF_VAR_access_key:?"Need to set TF_VAR_access_key non-empty"} | ||
export TF_VAR_secret_key=${TF_VAR_secret_key:?"Need to set TF_VAR_secret_key non-empty"} | ||
|
||
# Overrides default folder in Terraform.py inventory. | ||
export TF_VAR_STATE_ROOT="${APOLLO_ROOT}/terraform/${APOLLO_PROVIDER}" | ||
|
||
export ANSIBLE_SSH_ARGS="-F ${APOLLO_ROOT}/terraform/${APOLLO_PROVIDER}/ssh.config -q" | ||
|
||
export TF_VAR_region=${TF_VAR_region:-eu-west-1} | ||
export APOLLO_consul_dc=${APOLLO_consul_dc:-$TF_VAR_region} | ||
export APOLLO_mesos_cluster_name=${APOLLO_mesos_cluster_name:-$TF_VAR_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
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,13 @@ | ||
#!/bin/bash | ||
|
||
export TF_VAR_access_key=${TF_VAR_access_key:?"Need to set TF_VAR_access_key non-empty"} | ||
export TF_VAR_secret_key=${TF_VAR_secret_key:?"Need to set TF_VAR_secret_key non-empty"} | ||
|
||
# Overrides default folder in Terraform.py inventory. | ||
export TF_VAR_STATE_ROOT="${APOLLO_ROOT}/terraform/${APOLLO_PROVIDER}" | ||
|
||
export ANSIBLE_SSH_ARGS="-F ${APOLLO_ROOT}/terraform/${APOLLO_PROVIDER}/ssh.config -q" | ||
|
||
export TF_VAR_region=${TF_VAR_region:-eu-west-1} | ||
export APOLLO_consul_dc=${APOLLO_consul_dc:-$TF_VAR_region} | ||
export APOLLO_mesos_cluster_name=${APOLLO_mesos_cluster_name:-$TF_VAR_region} |
File renamed without changes.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,45 @@ | ||
variable "elb_name" { default = "apollo-elb" } | ||
variable "backend_port" { default = "80"} | ||
variable "backend_protocol" { default = "http" } | ||
variable "health_check_target" { default = "HTTP:8888/health" } | ||
variable "instances" {} | ||
variable "subnets" {} | ||
variable "security_groups" {} | ||
|
||
resource "aws_elb" "elb" { | ||
name = "${var.elb_name}" | ||
cross_zone_load_balancing = true | ||
subnets = ["${split(\",\", var.subnets)}"] | ||
security_groups = ["${split(\",\",var.security_groups)}"] | ||
instances = ["${split(\",\", var.instances)}"] | ||
listener { | ||
instance_port = "${var.backend_port}" | ||
instance_protocol = "${var.backend_protocol}" | ||
lb_port = 80 | ||
lb_protocol = "http" | ||
} | ||
# Traefik health check | ||
health_check { | ||
healthy_threshold = 2 | ||
unhealthy_threshold = 2 | ||
timeout = 3 | ||
target = "${var.health_check_target}" | ||
interval = 30 | ||
} | ||
tags { | ||
Name = "${var.elb_name}" | ||
} | ||
} | ||
resource "aws_proxy_protocol_policy" "http" { | ||
load_balancer = "${aws_elb.elb.name}" | ||
instance_ports = ["80"] | ||
} | ||
# outputs | ||
output "elb_id" { value = "${aws_elb.elb.id}" } | ||
output "elb_name" { value = "${aws_elb.elb.name}" } | ||
output "elb_dns_name" { value = "${aws_elb.elb.dns_name}" } |
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,14 @@ | ||
# input variables | ||
variable "short_name" { default = "apollo" } | ||
variable "public_key_filename" { default = "~/.ssh/id_rsa_aws.pub" } | ||
|
||
# SSH keypair for the instances | ||
resource "aws_key_pair" "default" { | ||
key_name = "${var.short_name}" | ||
public_key = "${file(var.public_key_filename)}" | ||
} | ||
|
||
# output variables | ||
output "keypair_name" { | ||
value = "${aws_key_pair.default.key_name}" | ||
} |
Oops, something went wrong.