diff --git a/.gitignore b/.gitignore index 95dfea7..2faf43d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,12 +7,14 @@ # Crash log files crash.log +crash.*.log -# Ignore any .tfvars files that are generated automatically for each Terraform run. Most -# .tfvars files are managed as part of configuration and so should be included in -# version control. -# -# example.tfvars +# Exclude all .tfvars files, which are likely to contain sensitive data, such as +# password, private keys, and other secrets. These should not be part of version +# control as they are data points which are potentially sensitive and subject +# to change depending on the environment. +*.tfvars +*.tfvars.json # Ignore override files as they are usually used to override resources locally and so # are not checked in @@ -21,10 +23,15 @@ override.tf.json *_override.tf *_override.tf.json +# Ignore transient lock info files created by terraform apply +.terraform.tfstate.lock.info + # Include override files you do wish to add to version control using negated pattern -# # !example_override.tf # Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan # example: *tfplan* -.terraform.lock.hcl + +# Ignore CLI configuration files +.terraformrc +terraform.rc diff --git a/CODEOWNERS b/CODEOWNERS index d91b77f..b3ac177 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,3 +1,3 @@ #### How to use this file: https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners # These owners will be the default owners for everything in the repo. Unless a later match takes precedence -* @roknsound/terraform-reviewers +* @RoknSound-Public-Modules/terraform-reviewers diff --git a/README.md b/README.md index 52a6a1e..08a4172 100644 --- a/README.md +++ b/README.md @@ -1,97 +1,2 @@ # terraform-github-repo -Module to automate creation of -* github related resources - * repo - * default branch - * branch protection rule for main branch - * default codeowners and backend.tf file - * team access - - -## Requirements - -| Name | Version | -|------|---------| -| [github](#requirement\_github) | >= 6.2.2 | - -## Providers - -| Name | Version | -|------|---------| -| [github](#provider\_github) | 6.2.3 | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [github_actions_secret.secret](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/actions_secret) | resource | -| [github_actions_variable.variable](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/actions_variable) | resource | -| [github_branch.branch](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/branch) | resource | -| [github_branch_default.default_main_branch](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/branch_default) | resource | -| [github_branch_protection.main](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/branch_protection) | resource | -| [github_repository.repo](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/repository) | resource | -| [github_repository_collaborator.collaborators](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/repository_collaborator) | resource | -| [github_repository_file.codeowners](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/repository_file) | resource | -| [github_repository_file.extra_files](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/repository_file) | resource | -| [github_repository_file.managed_extra_files](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/repository_file) | resource | -| [github_team_repository.admin](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/team_repository) | resource | -| [github_organization_teams.root_teams](https://registry.terraform.io/providers/integrations/github/latest/docs/data-sources/organization_teams) | data source | -| [github_ref.ref](https://registry.terraform.io/providers/integrations/github/latest/docs/data-sources/ref) | data source | -| [github_repository.template_repo](https://registry.terraform.io/providers/integrations/github/latest/docs/data-sources/repository) | data source | -| [github_user.pull_request_bypassers](https://registry.terraform.io/providers/integrations/github/latest/docs/data-sources/user) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [additional\_codeowners](#input\_additional\_codeowners) | Enable adding of Codeowner Teams | `list(any)` | `[]` | no | -| [admin\_teams](#input\_admin\_teams) | Admin Teams | `list(any)` | `[]` | no | -| [archive\_on\_destroy](#input\_archive\_on\_destroy) | n/a | `bool` | `true` | no | -| [archived](#input\_archived) | n/a | `bool` | `false` | no | -| [collaborators](#input\_collaborators) | list of repo callaborators | `map(string)` | `{}` | no | -| [create\_codeowners](#input\_create\_codeowners) | n/a | `bool` | `true` | no | -| [enforce\_prs](#input\_enforce\_prs) | n/a | `bool` | `true` | no | -| [extra\_files](#input\_extra\_files) | Extra Files |
list(object({
path = string,
content = string
}))
| `[]` | no | -| [force\_name](#input\_force\_name) | Force Naming of Repo. If forced, archive management will not operate on this repo | `bool` | `false` | no | -| [github\_allow\_merge\_commit](#input\_github\_allow\_merge\_commit) | n/a | `bool` | `false` | no | -| [github\_allow\_rebase\_merge](#input\_github\_allow\_rebase\_merge) | n/a | `bool` | `false` | no | -| [github\_allow\_squash\_merge](#input\_github\_allow\_squash\_merge) | n/a | `bool` | `true` | no | -| [github\_auto\_init](#input\_github\_auto\_init) | n/a | `bool` | `true` | no | -| [github\_codeowners\_team](#input\_github\_codeowners\_team) | n/a | `string` | `"terraform-reviewers"` | no | -| [github\_default\_branch](#input\_github\_default\_branch) | n/a | `string` | `"main"` | no | -| [github\_delete\_branch\_on\_merge](#input\_github\_delete\_branch\_on\_merge) | n/a | `bool` | `true` | no | -| [github\_dismiss\_stale\_reviews](#input\_github\_dismiss\_stale\_reviews) | n/a | `bool` | `true` | no | -| [github\_enforce\_admins\_branch\_protection](#input\_github\_enforce\_admins\_branch\_protection) | n/a | `bool` | `true` | no | -| [github\_has\_issues](#input\_github\_has\_issues) | n/a | `bool` | `false` | no | -| [github\_has\_projects](#input\_github\_has\_projects) | n/a | `bool` | `true` | no | -| [github\_has\_wiki](#input\_github\_has\_wiki) | n/a | `bool` | `true` | no | -| [github\_is\_private](#input\_github\_is\_private) | n/a | `bool` | `true` | no | -| [github\_org\_teams](#input\_github\_org\_teams) | provide module with list of teams so that module does not need to look them up | `list(any)` | `null` | no | -| [github\_push\_restrictions](#input\_github\_push\_restrictions) | Github Push Restrictions | `list(any)` | `[]` | no | -| [github\_repo\_description](#input\_github\_repo\_description) | n/a | `any` | `null` | no | -| [github\_repo\_topics](#input\_github\_repo\_topics) | Github Repo Topics | `list(any)` | `[]` | no | -| [github\_require\_code\_owner\_reviews](#input\_github\_require\_code\_owner\_reviews) | n/a | `bool` | `true` | no | -| [github\_required\_approving\_review\_count](#input\_github\_required\_approving\_review\_count) | n/a | `number` | `1` | no | -| [is\_template](#input\_is\_template) | n/a | `bool` | `false` | no | -| [managed\_extra\_files](#input\_managed\_extra\_files) | Managed Extra Files. Changes to Content will be updated |
list(object({
path = string,
content = string
}))
| `[]` | no | -| [name](#input\_name) | Name of the terraform workspace and optionally github repo | `any` | n/a | yes | -| [prefix](#input\_prefix) | n/a | `any` | `null` | no | -| [pull\_request\_bypassers](#input\_pull\_request\_bypassers) | n/a | `list(any)` | `[]` | no | -| [repo\_org](#input\_repo\_org) | n/a | `any` | `null` | no | -| [required\_status\_checks](#input\_required\_status\_checks) | Required Status Checks
required\_status\_checks supports the following arguments:

strict: (Optional) Require branches to be up to date before merging. Defaults to false.
contexts: (Optional) The list of status checks to require in order to merge into this branch.
No status checks are required by default.
Note: This attribute can contain multiple string patterns. If specified, usual value is the job name.
Otherwise, the job id is defaulted to. For workflows that use matrixes, append the matrix name to the
value using the following pattern ([, ]). Matrixes should be specified
based on the order of matrix properties in the workflow file. See GitHub Documentation for more
information. For workflows that use reusable workflows,
the pattern is / .
This can extend multiple levels. |
object({
contexts = list(string)
strict = optional(bool, false)
})
| `null` | no | -| [secrets](#input\_secrets) | Github Action Secrets |
list(object({
name = string,
value = string
}))
| `[]` | no | -| [template\_repo](#input\_template\_repo) | n/a | `any` | `null` | no | -| [template\_repo\_org](#input\_template\_repo\_org) | n/a | `any` | `null` | no | -| [vars](#input\_vars) | Github Action Vars |
list(object({
name = string,
value = string
}))
| `[]` | no | -| [vulnerability\_alerts](#input\_vulnerability\_alerts) | n/a | `bool` | `false` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| [github\_repo](#output\_github\_repo) | n/a | - \ No newline at end of file +Terraform Module