Skip to content

Commit

Permalink
docs: Update examples to show inputs required for Atlantis vs the web…
Browse files Browse the repository at this point in the history
…hook (#396)
  • Loading branch information
bryantbiggs authored Feb 1, 2024
1 parent 8126422 commit 1cd8db8
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.83.6
rev: v1.86.0
hooks:
- id: terraform_fmt
- id: terraform_validate
Expand All @@ -26,3 +26,5 @@ repos:
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: end-of-file-fixer
- id: trailing-whitespace
1 change: 1 addition & 0 deletions examples/github-complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Note that this example may create resources which cost money. Run `terraform des
| <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 |
| <a name="input_github_owner"></a> [github\_owner](#input\_github\_owner) | Github owner to use when creating webhook | `string` | n/a | yes |
| <a name="input_github_token"></a> [github\_token](#input\_github\_token) | Github token to use when creating webhook | `string` | n/a | yes |
| <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 |

## Outputs

Expand Down
2 changes: 1 addition & 1 deletion examples/github-complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ module "atlantis" {
module "github_repository_webhooks" {
source = "../../modules/github-repository-webhook"

repositories = var.atlantis_repo_allowlist
repositories = var.repositories

webhook_url = "${module.atlantis.url}/events"
webhook_secret = random_password.webhook_secret.result
Expand Down
4 changes: 3 additions & 1 deletion examples/github-complete/terraform.tfvars.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ github_owner = "me"
domain = "mydomain.com"

atlantis_github_user = "JohnDoe"
atlantis_repo_allowlist = ["my-repo"]
# Format is {hostname}/{owner}/{repo} https://www.runatlantis.io/docs/server-configuration.html#repo-allowlist
atlantis_repo_allowlist = ["github.com/johndoe/*"]
repositories = ["myrepo"]
5 changes: 5 additions & 0 deletions examples/github-complete/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ variable "atlantis_repo_allowlist" {
description = "List of GitHub repositories that Atlantis will be allowed to access"
type = list(string)
}

variable "repositories" {
description = "List of GitHub repositories to create webhooks for. This is just the name of the repository, excluding the user or organization"
type = list(string)
}
1 change: 1 addition & 0 deletions examples/github-separate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Note that this example may create resources which cost money. Run `terraform des
| <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 |
| <a name="input_github_owner"></a> [github\_owner](#input\_github\_owner) | Github owner to use when creating webhook | `string` | n/a | yes |
| <a name="input_github_token"></a> [github\_token](#input\_github\_token) | Github token to use when creating webhook | `string` | n/a | yes |
| <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 |

## Outputs

Expand Down
2 changes: 1 addition & 1 deletion examples/github-separate/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ module "atlantis" {
module "github_repository_webhooks" {
source = "../../modules/github-repository-webhook"

repositories = var.atlantis_repo_allowlist
repositories = var.repositories

webhook_url = "http://${module.alb.dns_name}/events"
webhook_secret = random_password.webhook_secret.result
Expand Down
4 changes: 3 additions & 1 deletion examples/github-separate/terraform.tfvars.sample
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ github_token = "ghp_aldkfjadkfjaldfjk"
github_owner = "me"

atlantis_github_user = "JohnDoe"
atlantis_repo_allowlist = ["my-repo"]
# Format is {hostname}/{owner}/{repo} https://www.runatlantis.io/docs/server-configuration.html#repo-allowlist
atlantis_repo_allowlist = ["github.com/johndoe/*"]
repositories = ["myrepo"]
5 changes: 5 additions & 0 deletions examples/github-separate/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ variable "atlantis_repo_allowlist" {
description = "List of GitHub repositories that Atlantis will be allowed to access"
type = list(string)
}

variable "repositories" {
description = "List of GitHub repositories to create webhooks for. This is just the name of the repository, excluding the user or organization"
type = list(string)
}

0 comments on commit 1cd8db8

Please sign in to comment.