Skip to content

Commit 742cabf

Browse files
authored
feat: add variable to set SSL listener policy (#150)
1 parent 9128f80 commit 742cabf

File tree

7 files changed

+18
-9
lines changed

7 files changed

+18
-9
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ allow_github_webhooks = true
186186
| alb\_http\_security\_group\_tags | Additional tags to put on the http security group | `map(string)` | `{}` | no |
187187
| alb\_https\_security\_group\_tags | Additional tags to put on the https security group | `map(string)` | `{}` | no |
188188
| alb\_ingress\_cidr\_blocks | List of IPv4 CIDR ranges to use on all ingress rules of the ALB. | `list(string)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
189+
| alb\_listener\_ssl\_policy\_default | The security policy if using HTTPS externally on the load balancer. [See](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html). | `string` | `"ELBSecurityPolicy-2016-08"` | no |
189190
| alb\_log\_bucket\_name | S3 bucket (externally created) for storing load balancer access logs. Required if alb\_logging\_enabled is true. | `string` | `""` | no |
190191
| alb\_log\_location\_prefix | S3 prefix within the log\_bucket\_name under which logs are stored. | `string` | `""` | no |
191192
| alb\_logging\_enabled | Controls if the ALB will log requests to S3. | `bool` | `false` | no |

examples/github-complete/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ No requirements.
3939

4040
| Name | Description | Type | Default | Required |
4141
|------|-------------|------|---------|:--------:|
42+
| alb\_ingress\_cidr\_blocks | List of IPv4 CIDR ranges to use on all ingress rules of the ALB - use your personal IP in the form of `x.x.x.x/32` for restricted testing | `list(string)` | n/a | yes |
4243
| allowed\_repo\_names | Repositories that Atlantis will listen for events from and a webhook will be installed | `list(string)` | n/a | yes |
4344
| domain | Route53 domain name to use for ACM certificate. Route53 zone for this domain should be created in advance | `string` | n/a | yes |
4445
| github\_organization | Github organization | `string` | n/a | yes |
4546
| github\_token | Github token | `string` | n/a | yes |
4647
| github\_user | Github user for Atlantis to utilize when performing Github activities | `string` | n/a | yes |
47-
| personal\_ip | Your current, personally ip to restrict access to Atlantis UI ending with `/32` for subnet | `string` | n/a | yes |
4848
| region | AWS region where resources will be created | `string` | `"us-east-1"` | no |
4949

5050
## Outputs

examples/github-complete/main.tf

+5-4
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ module "atlantis" {
6969
atlantis_allowed_repo_names = var.allowed_repo_names
7070

7171
# ALB access
72-
alb_ingress_cidr_blocks = [var.personal_ip]
73-
alb_logging_enabled = true
74-
alb_log_bucket_name = module.atlantis_access_log_bucket.this_s3_bucket_id
75-
alb_log_location_prefix = "atlantis-alb"
72+
alb_ingress_cidr_blocks = var.alb_ingress_cidr_blocks
73+
alb_logging_enabled = true
74+
alb_log_bucket_name = module.atlantis_access_log_bucket.this_s3_bucket_id
75+
alb_log_location_prefix = "atlantis-alb"
76+
alb_listener_ssl_policy_default = "ELBSecurityPolicy-TLS-1-2-2017-01"
7677

7778
allow_unauthenticated_access = true
7879
allow_github_webhooks = true

examples/github-complete/terraform.tfvars.sample

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
region = "eu-west-1"
22
domain = "mydomain.com"
3-
personal_ip = "x.x.x.x/32"
3+
alb_ingress_cidr_blocks = ["x.x.x.x/32"]
44
github_organization = "myorg"
55
github_user = "atlantis"
66
github_token = "mygithubpersonalaccesstokenforatlantis"

examples/github-complete/variables.tf

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ variable "domain" {
99
type = string
1010
}
1111

12-
variable "personal_ip" {
13-
description = "Your current, personally ip to restrict access to Atlantis UI ending with `/32` for subnet"
14-
type = string
12+
variable "alb_ingress_cidr_blocks" {
13+
description = "List of IPv4 CIDR ranges to use on all ingress rules of the ALB - use your personal IP in the form of `x.x.x.x/32` for restricted testing"
14+
type = list(string)
1515
}
1616

1717
variable "github_token" {

main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ module "alb" {
198198
prefix = var.alb_log_location_prefix
199199
}
200200

201+
listener_ssl_policy_default = var.alb_listener_ssl_policy_default
201202
https_listeners = [
202203
{
203204
target_group_index = 0

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ variable "whitelist_unauthenticated_cidr_blocks" {
150150
default = []
151151
}
152152

153+
variable "alb_listener_ssl_policy_default" {
154+
description = "The security policy if using HTTPS externally on the load balancer. [See](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html)."
155+
type = string
156+
default = "ELBSecurityPolicy-2016-08"
157+
}
158+
153159
# ACM
154160
variable "certificate_arn" {
155161
description = "ARN of certificate issued by AWS ACM. If empty, a new ACM certificate will be created and validated using Route53 DNS"

0 commit comments

Comments
 (0)