Skip to content

Commit 26fab69

Browse files
committed
refactor: make the atlantis docker image configurable
1 parent 2257018 commit 26fab69

File tree

8 files changed

+16
-4
lines changed

8 files changed

+16
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ This Terraform module automates the deployment of the Atlantis server on an ECS
7474
7575
| Name | Description | Type | Default | Required |
7676
|------|-------------|------|---------|:--------:|
77+
| <a name="input_atlantis_docker_image"></a> [atlantis\_docker\_image](#input\_atlantis\_docker\_image) | Docker image for Atlantis | `string` | n/a | yes |
7778
| <a name="input_atlantis_gh_user"></a> [atlantis\_gh\_user](#input\_atlantis\_gh\_user) | The GitHub username used by Atlantis to access repositories | `string` | n/a | yes |
7879
| <a name="input_atlantis_repo_allowlist"></a> [atlantis\_repo\_allowlist](#input\_atlantis\_repo\_allowlist) | Comma delimited string containing repos to use atlantis | `string` | n/a | yes |
7980
| <a name="input_atlantis_url"></a> [atlantis\_url](#input\_atlantis\_url) | Full URL for the Atlantis server | `string` | n/a | yes |

examples/complete/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ atlantis_repo_allowlist = ["repo1", "repo2"]
1212
1313
# Optional Parameters
1414
thumbprint_list = ["your-thumbprint-1", "your-thumbprint-2"]
15+
atlantis_docker_image = "your-docker-image"
1516
```

examples/complete/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ module "atlantis" {
77
atlantis_repo_allowlist = var.atlantis_repo_allowlist
88
atlantis_url = var.atlantis_url
99
thumbprint_list = var.thumbprint_list
10+
atlantis_docker_image = var.atlantis_docker_image
1011
}

examples/complete/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,9 @@ variable "thumbprint_list" {
3333
type = list(string)
3434
default = ["e252aa6e92432f32cbc1b182056627c239652678"]
3535
}
36+
37+
variable "atlantis_docker_image" {
38+
description = "Docker image for Atlantis"
39+
type = string
40+
default = "ghcr.io/runatlantis/atlantis:v0.23.1"
41+
}

locals.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
locals {
22
google_oidc_endpoint = "https://accounts.google.com"
3-
thumbprint_list = var.thumbprint_list
43
container_port = 4141
54
alb_ip_target_type = "ip"
65
ecs_container_definations_name = "atlantis"
76
alb_system_name = "atlantis"
87
domain_parts = split(".", var.atlantis_url)
98
base_domain = join(".", slice(local.domain_parts, length(local.domain_parts) - 2, length(local.domain_parts)))
109
sub_domain = join(".", slice(local.domain_parts, 0, length(local.domain_parts) - 2))
11-
ecs_container_definations_image = "ghcr.io/runatlantis/atlantis:v0.23.1"
1210
ecs_task_definition_family = "atlantis"
1311
task_definition_network_mode = "awsvpc"
1412
load_balancer_internal = "false"

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module "ecs_deployment" {
4444
execution_role_arn = aws_iam_role.task_role.arn
4545
container_definitions = [{
4646
name = local.ecs_container_definations_name
47-
image = local.ecs_container_definations_image
47+
image = var.atlantis_docker_image
4848
container_port = local.container_port
4949
environment = local.env_variables
5050
secrets = local.secrets

oidc.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
resource "aws_iam_openid_connect_provider" "google" {
22
client_id_list = [data.aws_ssm_parameter.environment["ATLANTIS_GOOGLE_CLIENT_ID"].value]
3-
thumbprint_list = local.thumbprint_list
3+
thumbprint_list = var.thumbprint_list
44
url = local.google_oidc_endpoint
55
}

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,8 @@ variable "thumbprint_list" {
5050
description = "The thumbprint of the OIDC provider"
5151
type = list(string)
5252
}
53+
54+
variable "atlantis_docker_image" {
55+
description = "Docker image for Atlantis"
56+
type = string
57+
}

0 commit comments

Comments
 (0)