Skip to content

Commit eb275af

Browse files
authored
Fix atlantis URL (#10)
1 parent fc116f5 commit eb275af

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ Available targets:
200200
| atlantis_port | Atlantis container port | string | `4141` | no |
201201
| atlantis_repo_config | Path to atlantis server-side repo config file (https://www.runatlantis.io/docs/server-side-repo-config.html) | string | `atlantis-repo-config.yaml` | no |
202202
| atlantis_repo_whitelist | Whitelist of repositories Atlantis will accept webhooks from | list | `<list>` | no |
203+
| atlantis_url_format | Template for the Atlantis URL which is populated with the hostname | string | `https://%s` | no |
203204
| atlantis_wake_word | Wake world for Atlantis | string | `atlantis` | no |
204205
| atlantis_webhook_format | Template for the Atlantis webhook URL which is populated with the hostname | string | `https://%s/events` | no |
205206
| attributes | Additional attributes (e.g. `1`) | list | `<list>` | no |

docs/terraform.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
| atlantis_port | Atlantis container port | string | `4141` | no |
2727
| atlantis_repo_config | Path to atlantis server-side repo config file (https://www.runatlantis.io/docs/server-side-repo-config.html) | string | `atlantis-repo-config.yaml` | no |
2828
| atlantis_repo_whitelist | Whitelist of repositories Atlantis will accept webhooks from | list | `<list>` | no |
29+
| atlantis_url_format | Template for the Atlantis URL which is populated with the hostname | string | `https://%s` | no |
2930
| atlantis_wake_word | Wake world for Atlantis | string | `atlantis` | no |
3031
| atlantis_webhook_format | Template for the Atlantis webhook URL which is populated with the hostname | string | `https://%s/events` | no |
3132
| attributes | Additional attributes (e.g. `1`) | list | `<list>` | no |

main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ 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)}"
2424
atlantis_webhook_url = "${format(var.atlantis_webhook_format, local.hostname)}"
25+
atlantis_url = "${format(var.atlantis_url_format, local.hostname)}"
2526
attributes = "${concat(list(var.short_name), var.attributes)}"
2627
default_hostname = "${join("", aws_route53_record.default.*.fqdn)}"
2728
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}"
@@ -188,11 +189,11 @@ resource "aws_ssm_parameter" "atlantis_port" {
188189

189190
resource "aws_ssm_parameter" "atlantis_atlantis_url" {
190191
count = "${local.enabled ? 1 : 0}"
191-
description = "URL to reach Atlantis e.g. for webhooks"
192+
description = "Atlantis URL"
192193
name = "${format(var.chamber_format, var.chamber_service, "atlantis_atlantis_url")}"
193194
overwrite = "${var.overwrite_ssm_parameter}"
194195
type = "String"
195-
value = "${local.hostname}"
196+
value = "${local.atlantis_url}"
196197
}
197198

198199
resource "aws_ssm_parameter" "atlantis_gh_user" {

outputs.tf

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

1111
output "atlantis_url" {
1212
description = "The URL endpoint for the atlantis server"
13-
value = "${local.hostname}"
13+
value = "${local.atlantis_url}"
1414
}
1515

1616
output "atlantis_webhook_url" {

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,12 @@ variable "atlantis_webhook_format" {
163163
description = "Template for the Atlantis webhook URL which is populated with the hostname"
164164
}
165165

166+
variable "atlantis_url_format" {
167+
type = "string"
168+
default = "https://%s"
169+
description = "Template for the Atlantis URL which is populated with the hostname"
170+
}
171+
166172
variable "autoscaling_min_capacity" {
167173
type = "string"
168174
description = "Atlantis minimum tasks to run"

0 commit comments

Comments
 (0)