Skip to content

Commit

Permalink
feat: Added atlantis_fqdn to override route53 and ALB dns name (closes
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbabenko committed May 12, 2020
1 parent 7a02ceb commit 0ea90d6
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ No requirements.
| atlantis\_bitbucket\_user | Bitbucket username that is running the Atlantis command | `string` | `""` | no |
| atlantis\_bitbucket\_user\_token | Bitbucket token of the user that is running the Atlantis command | `string` | `""` | no |
| atlantis\_bitbucket\_user\_token\_ssm\_parameter\_name | Name of SSM parameter to keep atlantis\_bitbucket\_user\_token | `string` | `"/atlantis/bitbucket/user/token"` | no |
| atlantis\_fqdn | FQDN of Atlantis to use. Set this only to override Route53 and ALB's DNS name. | `string` | `null` | no |
| atlantis\_github\_user | GitHub username that is running the Atlantis command | `string` | `""` | no |
| atlantis\_github\_user\_token | GitHub token of the user that is running the Atlantis command | `string` | `""` | no |
| atlantis\_github\_user\_token\_ssm\_parameter\_name | Name of SSM parameter to keep atlantis\_github\_user\_token | `string` | `"/atlantis/github/user/token"` | no |
Expand All @@ -160,8 +161,8 @@ No requirements.
| container\_memory\_reservation | The amount of memory (in MiB) to reserve for the container | `number` | `128` | no |
| create\_route53\_record | Whether to create Route53 record for Atlantis | `bool` | `true` | no |
| custom\_container\_definitions | A list of valid container definitions provided as a single valid JSON document. By default, the standard container definition is used. | `string` | `""` | no |
| custom\_environment\_secrets | List of additional secrets the container will use (list should contain maps with `name` and `valueFrom`) | `list(map(string))` | `[]` | no |
| custom\_environment\_variables | List of additional environment variables the container will use (list should contain maps with `name` and `value`) | `list(map(string))` | `[]` | no |
| custom\_environment\_secrets | List of additional secrets the container will use (list should contain maps with `name` and `valueFrom`) | <pre>list(object(<br> {<br> name = string<br> valueFrom = string<br> }<br> ))</pre> | `[]` | no |
| custom\_environment\_variables | List of additional environment variables the container will use (list should contain maps with `name` and `value`) | <pre>list(object(<br> {<br> name = string<br> value = string<br> }<br> ))</pre> | `[]` | no |
| ecs\_service\_assign\_public\_ip | Should be true, if ECS service is using public subnets (more info: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_cannot_pull_image.html) | `bool` | `false` | no |
| ecs\_service\_deployment\_maximum\_percent | The upper limit (as a percentage of the service's desiredCount) of the number of running tasks that can be running in a service during a deployment | `number` | `200` | no |
| ecs\_service\_deployment\_minimum\_healthy\_percent | The lower limit (as a percentage of the service's desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment | `number` | `50` | no |
Expand All @@ -187,6 +188,7 @@ No requirements.
| Name | Description |
|------|-------------|
| alb\_dns\_name | Dns name of alb |
| alb\_zone\_id | Zone ID of alb |
| atlantis\_allowed\_repo\_names | Git repositories where webhook should be created |
| atlantis\_url | URL of Atlantis |
| atlantis\_url\_events | Webhook events URL of Atlantis |
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ locals {
# Atlantis
atlantis_image = var.atlantis_image == "" ? "runatlantis/atlantis:${var.atlantis_version}" : var.atlantis_image
atlantis_url = "https://${coalesce(
var.atlantis_fqdn,
element(concat(aws_route53_record.atlantis.*.fqdn, [""]), 0),
module.alb.this_lb_dns_name,
"_"
Expand Down
5 changes: 5 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ output "alb_dns_name" {
value = module.alb.this_lb_dns_name
}

output "alb_zone_id" {
description = "Zone ID of alb"
value = module.alb.this_lb_zone_id
}

output "ecs_task_definition" {
description = "Task definition for ECS service (used for external triggers)"
value = aws_ecs_service.atlantis.task_definition
Expand Down
24 changes: 20 additions & 4 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ variable "tags" {
default = {}
}

variable "atlantis_fqdn" {
description = "FQDN of Atlantis to use. Set this only to override Route53 and ALB's DNS name."
type = string
default = null
}

# VPC
variable "vpc_id" {
description = "ID of an existing VPC where resources will be created"
Expand Down Expand Up @@ -298,14 +304,24 @@ variable "atlantis_bitbucket_base_url" {

variable "custom_environment_secrets" {
description = "List of additional secrets the container will use (list should contain maps with `name` and `valueFrom`)"
type = list(map(string))
default = []
type = list(object(
{
name = string
valueFrom = string
}
))
default = []
}

variable "custom_environment_variables" {
description = "List of additional environment variables the container will use (list should contain maps with `name` and `value`)"
type = list(map(string))
default = []
type = list(object(
{
name = string
value = string
}
))
default = []
}

variable "security_group_ids" {
Expand Down

0 comments on commit 0ea90d6

Please sign in to comment.