Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit 47bd5d4

Browse files
authored
fix: Fix the GitHub complete example (terraform-aws-modules#277)
1 parent a8328fc commit 47bd5d4

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

examples/github-complete/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ Go to https://eu-west-1.console.aws.amazon.com/ecs/home?region=eu-west-1#/settin
6363
| <a name="input_alb_ingress_cidr_blocks"></a> [alb\_ingress\_cidr\_blocks](#input\_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 |
6464
| <a name="input_domain"></a> [domain](#input\_domain) | Route53 domain name to use for ACM certificate. Route53 zone for this domain should be created in advance | `string` | n/a | yes |
6565
| <a name="input_github_owner"></a> [github\_owner](#input\_github\_owner) | Github owner | `string` | n/a | yes |
66+
| <a name="input_github_repo_names"></a> [github\_repo\_names](#input\_github\_repo\_names) | List of Github repositories that should be monitored by Atlantis | `list(string)` | n/a | yes |
6667
| <a name="input_github_token"></a> [github\_token](#input\_github\_token) | Github token | `string` | n/a | yes |
6768
| <a name="input_github_user"></a> [github\_user](#input\_github\_user) | Github user for Atlantis to utilize when performing Github activities | `string` | n/a | yes |
6869

examples/github-complete/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ module "atlantis" {
7676
# Atlantis
7777
atlantis_github_user = var.github_user
7878
atlantis_github_user_token = var.github_token
79-
atlantis_repo_allowlist = ["github.com/${var.github_owner}/*"]
79+
atlantis_repo_allowlist = [for repo in var.github_repo_names : "github.com/${var.github_owner}/${repo}"]
8080

8181
# ALB access
8282
alb_ingress_cidr_blocks = var.alb_ingress_cidr_blocks
@@ -103,7 +103,7 @@ module "github_repository_webhook" {
103103
github_owner = var.github_owner
104104
github_token = var.github_token
105105

106-
atlantis_repo_allowlist = module.atlantis.atlantis_repo_allowlist
106+
atlantis_repo_allowlist = var.github_repo_names
107107

108108
webhook_url = module.atlantis.atlantis_url_events
109109
webhook_secret = module.atlantis.webhook_secret

examples/github-complete/terraform.tfvars.sample

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ alb_ingress_cidr_blocks = ["x.x.x.x/32"]
33
github_owner = "myorg"
44
github_user = "atlantis"
55
github_token = "mygithubpersonalaccesstokenforatlantis"
6+
github_repo_names = ["mycoolrepo1", "mycoolrepo2"]

examples/github-complete/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ variable "github_user" {
2222
description = "Github user for Atlantis to utilize when performing Github activities"
2323
type = string
2424
}
25+
26+
variable "github_repo_names" {
27+
description = "List of Github repositories that should be monitored by Atlantis"
28+
type = list(string)
29+
}
30+

0 commit comments

Comments
 (0)