Skip to content

Commit

Permalink
Fix atlantis URL (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
aknysh authored May 18, 2019
1 parent 24c1549 commit fc116f5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ Available targets:
|------|-------------|
| atlantis_ssh_public_key | Atlantis SSH Public Key |
| atlantis_url | The URL endpoint for the atlantis server |
| atlantis_webhook_url | atlantis webhook URL |
| badge_url | The URL of the build badge when `badge_enabled` is enabled |


Expand Down
1 change: 1 addition & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,6 @@
|------|-------------|
| atlantis_ssh_public_key | Atlantis SSH Public Key |
| atlantis_url | The URL endpoint for the atlantis server |
| atlantis_webhook_url | atlantis webhook URL |
| badge_url | The URL of the build badge when `badge_enabled` is enabled |

6 changes: 3 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ data "aws_kms_key" "chamber_kms_key" {
locals {
enabled = "${var.enabled == "true" ? true : false}"
atlantis_gh_webhook_secret = "${length(var.atlantis_gh_webhook_secret) > 0 ? var.atlantis_gh_webhook_secret : join("", random_string.atlantis_gh_webhook_secret.*.result)}"
atlantis_url = "${format(var.atlantis_webhook_format, local.hostname)}"
atlantis_webhook_url = "${format(var.atlantis_webhook_format, local.hostname)}"
attributes = "${concat(list(var.short_name), var.attributes)}"
default_hostname = "${join("", aws_route53_record.default.*.fqdn)}"
github_oauth_token = "${length(join("", data.aws_ssm_parameter.atlantis_gh_token.*.value)) > 0 ? join("", data.aws_ssm_parameter.atlantis_gh_token.*.value) : var.github_oauth_token}"
Expand All @@ -48,7 +48,7 @@ module "webhooks" {
source = "git::https://github.com/cloudposse/terraform-github-repository-webhooks.git?ref=tags/0.3.0"
github_token = "${local.github_oauth_token}"
webhook_secret = "${local.atlantis_gh_webhook_secret}"
webhook_url = "${local.atlantis_url}"
webhook_url = "${local.atlantis_webhook_url}"
enabled = "${local.enabled}"
github_organization = "${var.repo_owner}"
github_repositories = ["${var.repo_name}"]
Expand Down Expand Up @@ -192,7 +192,7 @@ resource "aws_ssm_parameter" "atlantis_atlantis_url" {
name = "${format(var.chamber_format, var.chamber_service, "atlantis_atlantis_url")}"
overwrite = "${var.overwrite_ssm_parameter}"
type = "String"
value = "${local.atlantis_url}"
value = "${local.hostname}"
}

resource "aws_ssm_parameter" "atlantis_gh_user" {
Expand Down
7 changes: 6 additions & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@ output "badge_url" {

output "atlantis_url" {
description = "The URL endpoint for the atlantis server"
value = "${local.atlantis_url}"
value = "${local.hostname}"
}

output "atlantis_webhook_url" {
description = "atlantis webhook URL"
value = "${local.atlantis_webhook_url}"
}

0 comments on commit fc116f5

Please sign in to comment.