Skip to content

Commit fc116f5

Browse files
authored
Fix atlantis URL (#9)
1 parent 24c1549 commit fc116f5

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ Available targets:
262262
|------|-------------|
263263
| atlantis_ssh_public_key | Atlantis SSH Public Key |
264264
| atlantis_url | The URL endpoint for the atlantis server |
265+
| atlantis_webhook_url | atlantis webhook URL |
265266
| badge_url | The URL of the build badge when `badge_enabled` is enabled |
266267

267268

docs/terraform.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,6 @@
8888
|------|-------------|
8989
| atlantis_ssh_public_key | Atlantis SSH Public Key |
9090
| atlantis_url | The URL endpoint for the atlantis server |
91+
| atlantis_webhook_url | atlantis webhook URL |
9192
| badge_url | The URL of the build badge when `badge_enabled` is enabled |
9293

main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ data "aws_kms_key" "chamber_kms_key" {
2121
locals {
2222
enabled = "${var.enabled == "true" ? true : false}"
2323
atlantis_gh_webhook_secret = "${length(var.atlantis_gh_webhook_secret) > 0 ? var.atlantis_gh_webhook_secret : join("", random_string.atlantis_gh_webhook_secret.*.result)}"
24-
atlantis_url = "${format(var.atlantis_webhook_format, local.hostname)}"
24+
atlantis_webhook_url = "${format(var.atlantis_webhook_format, local.hostname)}"
2525
attributes = "${concat(list(var.short_name), var.attributes)}"
2626
default_hostname = "${join("", aws_route53_record.default.*.fqdn)}"
2727
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}"
@@ -48,7 +48,7 @@ module "webhooks" {
4848
source = "git::https://github.com/cloudposse/terraform-github-repository-webhooks.git?ref=tags/0.3.0"
4949
github_token = "${local.github_oauth_token}"
5050
webhook_secret = "${local.atlantis_gh_webhook_secret}"
51-
webhook_url = "${local.atlantis_url}"
51+
webhook_url = "${local.atlantis_webhook_url}"
5252
enabled = "${local.enabled}"
5353
github_organization = "${var.repo_owner}"
5454
github_repositories = ["${var.repo_name}"]
@@ -192,7 +192,7 @@ resource "aws_ssm_parameter" "atlantis_atlantis_url" {
192192
name = "${format(var.chamber_format, var.chamber_service, "atlantis_atlantis_url")}"
193193
overwrite = "${var.overwrite_ssm_parameter}"
194194
type = "String"
195-
value = "${local.atlantis_url}"
195+
value = "${local.hostname}"
196196
}
197197

198198
resource "aws_ssm_parameter" "atlantis_gh_user" {

outputs.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,10 @@ output "badge_url" {
1010

1111
output "atlantis_url" {
1212
description = "The URL endpoint for the atlantis server"
13-
value = "${local.atlantis_url}"
13+
value = "${local.hostname}"
14+
}
15+
16+
output "atlantis_webhook_url" {
17+
description = "atlantis webhook URL"
18+
value = "${local.atlantis_webhook_url}"
1419
}

0 commit comments

Comments
 (0)