Skip to content

Commit

Permalink
Fix callback url
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Simmerl committed Mar 27, 2017
1 parent df13450 commit f110c4f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
1 change: 0 additions & 1 deletion cmd/terraformer/terraformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ func main() {
}

args = []string{
argState, stateFile,
planFile,
}

Expand Down
10 changes: 10 additions & 0 deletions infrastructure/terraform/template/platform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ data "template_file" "domain_canonical" {
}
}

data "template_file" "domain_full" {
template = "$${sub}.$${root}.$${tld}"

vars {
root = "${element(split(".", var.domain), length(split(".", var.domain)) - 2)}"
sub = "${element(split(".", var.domain), length(split(".", var.domain)) - 3)}"
tld = "${element(split(".", var.domain), length(split(".", var.domain)) - 1)}"
}
}

resource "aws_elb" "console" {
connection_draining = true
connection_draining_timeout = 10
Expand Down
9 changes: 8 additions & 1 deletion infrastructure/terraform/template/scheduling.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@ resource "aws_ecs_service" "console" {
deployment_maximum_percent = 200
deployment_minimum_healthy_percent = 50
desired_count = 2
iam_role = "${aws_iam_role.ecs-scheduler.arn}"
name = "console"
task_definition = "${aws_ecs_task_definition.console.arn}"

load_balancer {
container_name = "console"
container_port = 8084
elb_name = "${aws_elb.console.id}"
}
}

resource "aws_ecs_task_definition" "console" {
Expand All @@ -22,7 +29,7 @@ resource "aws_ecs_task_definition" "console" {
"command": [
"./console",
"-env", "${var.env}",
"-google.callback", "https://console-${var.env}-${var.region}.${data.template_file.domain_canonical.rendered}/oauth2callback",
"-google.callback", "https://console-${var.env}-${var.region}.${data.template_file.domain_full.rendered}/oauth2callback",
"-google.client.id", "${var.google_client_id}",
"-google.client.secret", "${var.google_client_secret}",
"-postgres.url", "postgres://${var.pg_username}:${var.pg_password}@${aws_route53_record.service-master.fqdn}:5432/${var.pg_db_name}?connect_timeout=5&sslmode=require",
Expand Down
1 change: 1 addition & 0 deletions infrastructure/terraform/template/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ variable "pg_password" {

variable "version" {
default = {
"console" = "289"
"gateway-http" = "259"
"sims" = "259"
}
Expand Down

0 comments on commit f110c4f

Please sign in to comment.