diff --git a/.gitignore b/.gitignore
index 6964514..ee34fac 100644
--- a/.gitignore
+++ b/.gitignore
@@ -74,3 +74,5 @@ github/
*.ovpn
*.zip
+
+**/account-map
diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md
index dad0c1f..6355f24 100644
--- a/src/CHANGELOG.md
+++ b/src/CHANGELOG.md
@@ -1,3 +1,9 @@
+## `argocd-github-repo` Component PR [#17](https://github.com/cloudposse-terraform-components/aws-argocd-github-repo/pull/17)
+
+Corrected the spelling of "succeded" to "succeeded" in the `on-deploy-succeded` notification. As a result, both components (`argocd-github-repo` and `eks/argocd`) need to be updated to make this change.
+
+See the [PR for eks/argocd](https://github.com/cloudposse-terraform-components/aws-eks-argocd/pull/16)
+
## Components PR [#851](https://github.com/cloudposse/terraform-aws-components/pull/851)
This is a bug fix and feature enhancement update. There are few actions necessary to upgrade.
diff --git a/src/README.md b/src/README.md
index 2bef890..1ce3716 100644
--- a/src/README.md
+++ b/src/README.md
@@ -92,7 +92,6 @@ $ terraform import -var "import_profile_name=eg-mgmt-gbl-corp-admin" -var-file="
| [terraform](#requirement\_terraform) | >= 1.0.0 |
| [aws](#requirement\_aws) | >= 4.0 |
| [github](#requirement\_github) | >= 6.0 |
-| [random](#requirement\_random) | >= 2.3 |
| [tls](#requirement\_tls) | >= 3.0 |
## Providers
@@ -137,18 +136,19 @@ $ terraform import -var "import_profile_name=eg-mgmt-gbl-corp-admin" -var-file="
|------|-------------|------|---------|:--------:|
| [additional\_tag\_map](#input\_additional\_tag\_map) | Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`.
This is for some rare cases where resources want additional configuration of tags
and therefore take a list of maps with tag key, value, and additional configuration. | `map(string)` | `{}` | no |
| [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,
in the order they appear in the list. New attributes are appended to the
end of the list. The elements of the list are joined by the `delimiter`
and treated as a single ID element. | `list(string)` | `[]` | no |
+| [bypass\_pull\_request\_actors](#input\_bypass\_pull\_request\_actors) | List of GitHub usernames and team slugs that can bypass pull request requirements | `list(string)` | `[]` | no |
| [context](#input\_context) | Single object for setting entire context at once.
See description of individual variables for details.
Leave string and numeric variables as `null` to use default value.
Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional\_tag\_map, which are merged. | `any` |
{
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"descriptor_formats": {},
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"labels_as_tags": [
"unset"
],
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {},
"tenant": null
} | no |
| [create\_repo](#input\_create\_repo) | Whether or not to create the repository or use an existing one | `bool` | `true` | no |
| [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.
Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no |
| [description](#input\_description) | The description of the repository | `string` | `null` | no |
-| [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.
Map of maps. Keys are names of descriptors. Values are maps of the form
`{
format = string
labels = list(string)
}`
(Type is `any` so the map values can later be enhanced to provide additional options.)
`format` is a Terraform format string to be passed to the `format()` function.
`labels` is a list of labels, in order, to pass to `format()` function.
Label values will be normalized before being passed to `format()` so they will be
identical to how they appear in `id`.
Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no |
+| [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.
Map of maps. Keys are names of descriptors. Values are maps of the form
`{
format = string
labels = list(string)
}`
(Type is `any` so the map values can later be enhanced to provide additional options.)
`format` is a Terraform format string to be passed to the `format()` function.
`labels` is a list of labels, in order, to pass to `format()` function.
Label values will be normalized before being passed to `format()` so they will be
identical to how they appear in `id`.
Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no |
| [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `null` | no |
| [environment](#input\_environment) | ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |
| [environments](#input\_environments) | Environments to populate `applicationset.yaml` files and repository deploy keys (for ArgoCD) for.
`auto-sync` determines whether or not the ArgoCD application will be automatically synced.
`ignore-differences` determines whether or not the ArgoCD application will ignore the number of
replicas in the deployment. Read more on ignore differences here:
https://argo-cd.readthedocs.io/en/stable/user-guide/sync-options/#respect-ignore-difference-configs
Example:tenant: plat
environment: use1
stage: sandbox
auto-sync: true
ignore-differences:
- group: apps
kind: Deployment
json-pointers:
- /spec/replicas
| list(object({
tenant = optional(string, null)
environment = string
stage = string
attributes = optional(list(string), [])
auto-sync = bool
ignore-differences = optional(list(object({
group = string,
kind = string,
json-pointers = list(string)
})), [])
})) | `[]` | no |
| [github\_base\_url](#input\_github\_base\_url) | This is the target GitHub base API endpoint. Providing a value is a requirement when working with GitHub Enterprise. It is optional to provide this value and it can also be sourced from the `GITHUB_BASE_URL` environment variable. The value must end with a slash, for example: `https://terraformtesting-ghe.westus.cloudapp.azure.com/` | `string` | `null` | no |
| [github\_codeowner\_teams](#input\_github\_codeowner\_teams) | List of teams to use when populating the CODEOWNERS file.
For example: `["@ACME/cloud-admins", "@ACME/cloud-developers"]`. | `list(string)` | n/a | yes |
| [github\_default\_notifications\_enabled](#input\_github\_default\_notifications\_enabled) | Enable default GitHub commit statuses notifications (required for CD sync mode) | `string` | `true` | no |
-| [github\_notifications](#input\_github\_notifications) | ArgoCD notification annotations for subscribing to GitHub.
The default value given uses the same notification template names as defined in the `eks/argocd` component. If want to add additional notifications, include any existing notifications from this list that you want to keep in addition. | `list(string)` | [
"notifications.argoproj.io/subscribe.on-deploy-started.app-repo-github-commit-status: \"\"",
"notifications.argoproj.io/subscribe.on-deploy-started.argocd-repo-github-commit-status: \"\"",
"notifications.argoproj.io/subscribe.on-deploy-succeded.app-repo-github-commit-status: \"\"",
"notifications.argoproj.io/subscribe.on-deploy-succeded.argocd-repo-github-commit-status: \"\"",
"notifications.argoproj.io/subscribe.on-deploy-failed.app-repo-github-commit-status: \"\"",
"notifications.argoproj.io/subscribe.on-deploy-failed.argocd-repo-github-commit-status: \"\""
]
| no |
+| [github\_notifications](#input\_github\_notifications) | ArgoCD notification annotations for subscribing to GitHub.
The default value given uses the same notification template names as defined in the `eks/argocd` component. If want to add additional notifications, include any existing notifications from this list that you want to keep in addition. | `list(string)` | [
"notifications.argoproj.io/subscribe.on-deploy-started.app-repo-github-commit-status: \"\"",
"notifications.argoproj.io/subscribe.on-deploy-started.argocd-repo-github-commit-status: \"\"",
"notifications.argoproj.io/subscribe.on-deploy-succeeded.app-repo-github-commit-status: \"\"",
"notifications.argoproj.io/subscribe.on-deploy-succeeded.argocd-repo-github-commit-status: \"\"",
"notifications.argoproj.io/subscribe.on-deploy-failed.app-repo-github-commit-status: \"\"",
"notifications.argoproj.io/subscribe.on-deploy-failed.argocd-repo-github-commit-status: \"\""
]
| no |
| [github\_organization](#input\_github\_organization) | GitHub Organization | `string` | n/a | yes |
| [github\_token\_override](#input\_github\_token\_override) | Use the value of this variable as the GitHub token instead of reading it from SSM | `string` | `null` | no |
| [github\_user](#input\_github\_user) | Github user | `string` | n/a | yes |
@@ -174,6 +174,7 @@ $ terraform import -var "import_profile_name=eg-mgmt-gbl-corp-admin" -var-file="
| [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no |
| [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).
Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no |
| [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no |
+| [use\_local\_github\_credentials](#input\_use\_local\_github\_credentials) | Use local GitHub credentials from environment variables instead of SSM | `bool` | `false` | no |
| [vulnerability\_alerts\_enabled](#input\_vulnerability\_alerts\_enabled) | Enable security alerts for vulnerable dependencies | `bool` | `false` | no |
| [web\_commit\_signoff\_required](#input\_web\_commit\_signoff\_required) | Require contributors to sign off on web-based commits | `bool` | `false` | no |
diff --git a/src/context.tf b/src/context.tf
index e7dd3ea..5e0ef88 100644
--- a/src/context.tf
+++ b/src/context.tf
@@ -264,8 +264,8 @@ variable "descriptor_formats" {
Describe additional descriptors to be output in the `descriptors` output map.
Map of maps. Keys are names of descriptors. Values are maps of the form
`{
- format = string
- labels = list(string)
+ format = string
+ labels = list(string)
}`
(Type is `any` so the map values can later be enhanced to provide additional options.)
`format` is a Terraform format string to be passed to the `format()` function.
diff --git a/src/main.tf b/src/main.tf
index 06158b3..88be37c 100644
--- a/src/main.tf
+++ b/src/main.tf
@@ -85,6 +85,7 @@ resource "github_branch_protection" "default" {
dismiss_stale_reviews = true
restrict_dismissals = true
require_code_owner_reviews = true
+ pull_request_bypassers = var.bypass_pull_request_actors
}
}
diff --git a/src/provider-github.tf b/src/provider-github.tf
index 60ed4e0..5b0b921 100644
--- a/src/provider-github.tf
+++ b/src/provider-github.tf
@@ -1,9 +1,11 @@
locals {
- github_token = local.enabled ? coalesce(var.github_token_override, data.aws_ssm_parameter.github_api_key[0].value) : ""
+ github_token = local.enabled ? (
+ var.use_local_github_credentials ? null : coalesce(var.github_token_override, data.aws_ssm_parameter.github_api_key[0].value)
+ ) : ""
}
data "aws_ssm_parameter" "github_api_key" {
- count = local.enabled ? 1 : 0
+ count = local.enabled && !var.use_local_github_credentials ? 1 : 0
name = var.ssm_github_api_key
with_decryption = true
}
diff --git a/src/variables.tf b/src/variables.tf
index 02fc4e4..080b80e 100644
--- a/src/variables.tf
+++ b/src/variables.tf
@@ -180,8 +180,8 @@ variable "github_notifications" {
default = [
"notifications.argoproj.io/subscribe.on-deploy-started.app-repo-github-commit-status: \"\"",
"notifications.argoproj.io/subscribe.on-deploy-started.argocd-repo-github-commit-status: \"\"",
- "notifications.argoproj.io/subscribe.on-deploy-succeded.app-repo-github-commit-status: \"\"",
- "notifications.argoproj.io/subscribe.on-deploy-succeded.argocd-repo-github-commit-status: \"\"",
+ "notifications.argoproj.io/subscribe.on-deploy-succeeded.app-repo-github-commit-status: \"\"",
+ "notifications.argoproj.io/subscribe.on-deploy-succeeded.argocd-repo-github-commit-status: \"\"",
"notifications.argoproj.io/subscribe.on-deploy-failed.app-repo-github-commit-status: \"\"",
"notifications.argoproj.io/subscribe.on-deploy-failed.argocd-repo-github-commit-status: \"\"",
]
@@ -197,3 +197,15 @@ variable "web_commit_signoff_required" {
description = "Require contributors to sign off on web-based commits"
default = false
}
+
+variable "bypass_pull_request_actors" {
+ type = list(string)
+ description = "List of GitHub usernames and team slugs that can bypass pull request requirements"
+ default = []
+}
+
+variable "use_local_github_credentials" {
+ type = bool
+ description = "Use local GitHub credentials from environment variables instead of SSM"
+ default = false
+}
diff --git a/src/versions.tf b/src/versions.tf
index 5cc992f..aacc3ad 100644
--- a/src/versions.tf
+++ b/src/versions.tf
@@ -14,9 +14,5 @@ terraform {
source = "hashicorp/tls"
version = ">= 3.0"
}
- random = {
- source = "hashicorp/random"
- version = ">= 2.3"
- }
}
}