Skip to content

Commit 1cd8db8

Browse files
authored
docs: Update examples to show inputs required for Atlantis vs the webhook (#396)
1 parent 8126422 commit 1cd8db8

File tree

9 files changed

+23
-5
lines changed

9 files changed

+23
-5
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.83.6
3+
rev: v1.86.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_validate
@@ -26,3 +26,5 @@ repos:
2626
rev: v4.5.0
2727
hooks:
2828
- id: check-merge-conflict
29+
- id: end-of-file-fixer
30+
- id: trailing-whitespace

examples/github-complete/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Note that this example may create resources which cost money. Run `terraform des
5757
| <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 |
5858
| <a name="input_github_owner"></a> [github\_owner](#input\_github\_owner) | Github owner to use when creating webhook | `string` | n/a | yes |
5959
| <a name="input_github_token"></a> [github\_token](#input\_github\_token) | Github token to use when creating webhook | `string` | n/a | yes |
60+
| <a name="input_repositories"></a> [repositories](#input\_repositories) | List of GitHub repositories to create webhooks for. This is just the name of the repository, excluding the user or organization | `list(string)` | n/a | yes |
6061

6162
## Outputs
6263

examples/github-complete/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ module "atlantis" {
108108
module "github_repository_webhooks" {
109109
source = "../../modules/github-repository-webhook"
110110

111-
repositories = var.atlantis_repo_allowlist
111+
repositories = var.repositories
112112

113113
webhook_url = "${module.atlantis.url}/events"
114114
webhook_secret = random_password.webhook_secret.result

examples/github-complete/terraform.tfvars.sample

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ github_owner = "me"
44
domain = "mydomain.com"
55

66
atlantis_github_user = "JohnDoe"
7-
atlantis_repo_allowlist = ["my-repo"]
7+
# Format is {hostname}/{owner}/{repo} https://www.runatlantis.io/docs/server-configuration.html#repo-allowlist
8+
atlantis_repo_allowlist = ["github.com/johndoe/*"]
9+
repositories = ["myrepo"]

examples/github-complete/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,8 @@ variable "atlantis_repo_allowlist" {
2222
description = "List of GitHub repositories that Atlantis will be allowed to access"
2323
type = list(string)
2424
}
25+
26+
variable "repositories" {
27+
description = "List of GitHub repositories to create webhooks for. This is just the name of the repository, excluding the user or organization"
28+
type = list(string)
29+
}

examples/github-separate/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Note that this example may create resources which cost money. Run `terraform des
5858
| <a name="input_atlantis_repo_allowlist"></a> [atlantis\_repo\_allowlist](#input\_atlantis\_repo\_allowlist) | List of GitHub repositories that Atlantis will be allowed to access | `list(string)` | n/a | yes |
5959
| <a name="input_github_owner"></a> [github\_owner](#input\_github\_owner) | Github owner to use when creating webhook | `string` | n/a | yes |
6060
| <a name="input_github_token"></a> [github\_token](#input\_github\_token) | Github token to use when creating webhook | `string` | n/a | yes |
61+
| <a name="input_repositories"></a> [repositories](#input\_repositories) | List of GitHub repositories to create webhooks for. This is just the name of the repository, excluding the user or organization | `list(string)` | n/a | yes |
6162

6263
## Outputs
6364

examples/github-separate/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ module "atlantis" {
8787
module "github_repository_webhooks" {
8888
source = "../../modules/github-repository-webhook"
8989

90-
repositories = var.atlantis_repo_allowlist
90+
repositories = var.repositories
9191

9292
webhook_url = "http://${module.alb.dns_name}/events"
9393
webhook_secret = random_password.webhook_secret.result

examples/github-separate/terraform.tfvars.sample

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ github_token = "ghp_aldkfjadkfjaldfjk"
22
github_owner = "me"
33

44
atlantis_github_user = "JohnDoe"
5-
atlantis_repo_allowlist = ["my-repo"]
5+
# Format is {hostname}/{owner}/{repo} https://www.runatlantis.io/docs/server-configuration.html#repo-allowlist
6+
atlantis_repo_allowlist = ["github.com/johndoe/*"]
7+
repositories = ["myrepo"]

examples/github-separate/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,8 @@ variable "atlantis_repo_allowlist" {
1717
description = "List of GitHub repositories that Atlantis will be allowed to access"
1818
type = list(string)
1919
}
20+
21+
variable "repositories" {
22+
description = "List of GitHub repositories to create webhooks for. This is just the name of the repository, excluding the user or organization"
23+
type = list(string)
24+
}

0 commit comments

Comments
 (0)