Skip to content

Commit bde2036

Browse files
authored
[eks/external-secrets-operator] Normalize variables, update dependencies (cloudposse/terraform-aws-components#708)
1 parent 52af907 commit bde2036

File tree

5 files changed

+59
-23
lines changed

5 files changed

+59
-23
lines changed

src/README.md

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,36 @@ components:
5252
vars:
5353
enabled: true
5454
name: "external-secrets-operator"
55+
helm_manifest_experiment_enabled: false
56+
chart: "external-secrets"
57+
chart_repository: "https://charts.external-secrets.io"
58+
chart_version: "0.8.3"
5559
kubernetes_namespace: "secrets"
5660
create_namespace: true
5761
timeout: 90
5862
wait: true
5963
atomic: true
6064
cleanup_on_fail: true
65+
tags:
66+
Team: sre
67+
Service: external-secrets-operator
68+
resources:
69+
limits:
70+
cpu: "100m"
71+
memory: "300Mi"
72+
requests:
73+
cpu: "20m"
74+
memory: "60Mi"
6175
parameter_store_paths:
6276
- app
6377
- rds
64-
78+
# You can use `chart_values` to set any other chart options. Treat `chart_values` as the root of the doc.
79+
#
80+
# # For example
81+
# ---
82+
# chart_values:
83+
# installCRDs: true
84+
chart_values: {}
6585
```
6686
6787
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
@@ -72,23 +92,23 @@ components:
7292
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 |
7393
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.0 |
7494
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | >= 2.0 |
75-
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 2.7.1 |
95+
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 2.7.1, != 2.21.0 |
7696
7797
## Providers
7898
7999
| Name | Version |
80100
|------|---------|
81101
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.0 |
82-
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | >= 2.7.1 |
102+
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | >= 2.7.1, != 2.21.0 |
83103
84104
## Modules
85105
86106
| Name | Source | Version |
87107
|------|--------|---------|
88108
| <a name="module_account_map"></a> [account\_map](#module\_account\_map) | cloudposse/stack-config/yaml//modules/remote-state | 1.4.1 |
89109
| <a name="module_eks"></a> [eks](#module\_eks) | cloudposse/stack-config/yaml//modules/remote-state | 1.4.1 |
90-
| <a name="module_external_secrets_operator"></a> [external\_secrets\_operator](#module\_external\_secrets\_operator) | cloudposse/helm-release/aws | 0.5.0 |
91-
| <a name="module_external_ssm_secrets"></a> [external\_ssm\_secrets](#module\_external\_ssm\_secrets) | cloudposse/helm-release/aws | 0.5.0 |
110+
| <a name="module_external_secrets_operator"></a> [external\_secrets\_operator](#module\_external\_secrets\_operator) | cloudposse/helm-release/aws | 0.8.1 |
111+
| <a name="module_external_ssm_secrets"></a> [external\_ssm\_secrets](#module\_external\_ssm\_secrets) | cloudposse/helm-release/aws | 0.8.1 |
92112
| <a name="module_iam_roles"></a> [iam\_roles](#module\_iam\_roles) | ../../account-map/modules/iam-roles | n/a |
93113
| <a name="module_this"></a> [this](#module\_this) | cloudposse/label/null | 0.25.0 |
94114
@@ -108,17 +128,20 @@ components:
108128
| <a name="input_additional_tag_map"></a> [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`.<br>This is for some rare cases where resources want additional configuration of tags<br>and therefore take a list of maps with tag key, value, and additional configuration. | `map(string)` | `{}` | no |
109129
| <a name="input_atomic"></a> [atomic](#input\_atomic) | If set, installation process purges chart on fail. The wait flag will be set automatically if atomic is used. | `bool` | `true` | no |
110130
| <a name="input_attributes"></a> [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,<br>in the order they appear in the list. New attributes are appended to the<br>end of the list. The elements of the list are joined by the `delimiter`<br>and treated as a single ID element. | `list(string)` | `[]` | no |
131+
| <a name="input_chart"></a> [chart](#input\_chart) | Chart name to be installed. The chart name can be local path, a URL to a chart, or the name of the chart if `repository` is specified. It is also possible to use the `<repository>/<chart>` format here if you are running Terraform on a system that the repository has been added to with `helm repo add` but this is not recommended. | `string` | `null` | no |
132+
| <a name="input_chart_description"></a> [chart\_description](#input\_chart\_description) | Set release description attribute (visible in the history). | `string` | `null` | no |
133+
| <a name="input_chart_repository"></a> [chart\_repository](#input\_chart\_repository) | Repository URL where to locate the requested chart. | `string` | `null` | no |
134+
| <a name="input_chart_values"></a> [chart\_values](#input\_chart\_values) | Additional values to yamlencode as `helm_release` values. | `any` | `{}` | no |
111135
| <a name="input_chart_version"></a> [chart\_version](#input\_chart\_version) | Specify the exact chart version to install. If this is not specified, the latest version is installed. | `string` | `null` | no |
112136
| <a name="input_cleanup_on_fail"></a> [cleanup\_on\_fail](#input\_cleanup\_on\_fail) | Allow deletion of new resources created in this upgrade when upgrade fails. | `bool` | `true` | no |
113137
| <a name="input_context"></a> [context](#input\_context) | Single object for setting entire context at once.<br>See description of individual variables for details.<br>Leave string and numeric variables as `null` to use default value.<br>Individual variable settings (non-null) override settings in context object,<br>except for attributes, tags, and additional\_tag\_map, which are merged. | `any` | <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": null,<br> "descriptor_formats": {},<br> "enabled": true,<br> "environment": null,<br> "id_length_limit": null,<br> "label_key_case": null,<br> "label_order": [],<br> "label_value_case": null,<br> "labels_as_tags": [<br> "unset"<br> ],<br> "name": null,<br> "namespace": null,<br> "regex_replace_chars": null,<br> "stage": null,<br> "tags": {},<br> "tenant": null<br>}</pre> | no |
114-
| <a name="input_create_namespace"></a> [create\_namespace](#input\_create\_namespace) | Create the Kubernetes namespace if it does not yet exist | `bool` | `true` | no |
138+
| <a name="input_create_namespace"></a> [create\_namespace](#input\_create\_namespace) | Create the Kubernetes namespace if it does not yet exist | `bool` | `null` | no |
115139
| <a name="input_delimiter"></a> [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.<br>Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no |
116-
| <a name="input_description"></a> [description](#input\_description) | Set release description attribute (visible in the history). | `string` | `null` | no |
117140
| <a name="input_descriptor_formats"></a> [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.<br>Map of maps. Keys are names of descriptors. Values are maps of the form<br>`{<br> format = string<br> labels = list(string)<br>}`<br>(Type is `any` so the map values can later be enhanced to provide additional options.)<br>`format` is a Terraform format string to be passed to the `format()` function.<br>`labels` is a list of labels, in order, to pass to `format()` function.<br>Label values will be normalized before being passed to `format()` so they will be<br>identical to how they appear in `id`.<br>Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no |
118141
| <a name="input_eks_component_name"></a> [eks\_component\_name](#input\_eks\_component\_name) | The name of the eks component | `string` | `"eks/cluster"` | no |
119142
| <a name="input_enabled"></a> [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `null` | no |
120143
| <a name="input_environment"></a> [environment](#input\_environment) | ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |
121-
| <a name="input_helm_manifest_experiment_enabled"></a> [helm\_manifest\_experiment\_enabled](#input\_helm\_manifest\_experiment\_enabled) | Enable storing of the rendered manifest for helm\_release so the full diff of what is changing can been seen in the plan | `bool` | `true` | no |
144+
| <a name="input_helm_manifest_experiment_enabled"></a> [helm\_manifest\_experiment\_enabled](#input\_helm\_manifest\_experiment\_enabled) | Enable storing of the rendered manifest for helm\_release so the full diff of what is changing can been seen in the plan | `bool` | `false` | no |
122145
| <a name="input_id_length_limit"></a> [id\_length\_limit](#input\_id\_length\_limit) | Limit `id` to this many characters (minimum 6).<br>Set to `0` for unlimited length.<br>Set to `null` for keep the existing setting, which defaults to `0`.<br>Does not affect `id_full`. | `number` | `null` | no |
123146
| <a name="input_import_profile_name"></a> [import\_profile\_name](#input\_import\_profile\_name) | AWS Profile name to use when importing a resource | `string` | `null` | no |
124147
| <a name="input_import_role_arn"></a> [import\_role\_arn](#input\_import\_role\_arn) | IAM Role ARN to use when importing a resource | `string` | `null` | no |
@@ -143,7 +166,6 @@ components:
143166
| <a name="input_rbac_enabled"></a> [rbac\_enabled](#input\_rbac\_enabled) | Service Account for pods. | `bool` | `true` | no |
144167
| <a name="input_regex_replace_chars"></a> [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.<br>Characters matching the regex will be removed from the ID elements.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
145168
| <a name="input_region"></a> [region](#input\_region) | AWS Region | `string` | n/a | yes |
146-
| <a name="input_repository"></a> [repository](#input\_repository) | Repository URL where to locate the requested chart. | `string` | `null` | no |
147169
| <a name="input_resources"></a> [resources](#input\_resources) | The cpu and memory of the deployment's limits and requests. | <pre>object({<br> limits = object({<br> cpu = string<br> memory = string<br> })<br> requests = object({<br> cpu = string<br> memory = string<br> })<br> })</pre> | n/a | yes |
148170
| <a name="input_stage"></a> [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no |
149171
| <a name="input_tags"></a> [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).<br>Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no |

src/helm-variables.tf

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,40 @@ variable "kubernetes_namespace" {
33
description = "The namespace to install the release into."
44
}
55

6-
variable "description" {
6+
variable "chart_description" {
77
type = string
88
description = "Set release description attribute (visible in the history)."
99
default = null
1010
}
1111

12-
variable "repository" {
12+
variable "chart_repository" {
1313
type = string
1414
description = "Repository URL where to locate the requested chart."
1515
default = null
1616
}
1717

18+
variable "chart" {
19+
type = string
20+
description = "Chart name to be installed. The chart name can be local path, a URL to a chart, or the name of the chart if `repository` is specified. It is also possible to use the `<repository>/<chart>` format here if you are running Terraform on a system that the repository has been added to with `helm repo add` but this is not recommended."
21+
default = null
22+
}
23+
1824
variable "chart_version" {
1925
type = string
2026
description = "Specify the exact chart version to install. If this is not specified, the latest version is installed."
2127
default = null
2228
}
2329

30+
variable "chart_values" {
31+
type = any
32+
description = "Additional values to yamlencode as `helm_release` values."
33+
default = {}
34+
}
35+
2436
variable "create_namespace" {
2537
type = bool
2638
description = "Create the Kubernetes namespace if it does not yet exist"
27-
default = true
39+
default = null
2840
}
2941

3042
variable "verify" {

src/main.tf

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ resource "kubernetes_namespace" "default" {
1818
# https://external-secrets.io/v0.5.9/guides-getting-started/
1919
module "external_secrets_operator" {
2020
source = "cloudposse/helm-release/aws"
21-
version = "0.5.0"
21+
version = "0.8.1"
2222

23-
name = "" # avoids hitting length restrictions on IAM Role names
24-
description = "External Secrets Operator is a Kubernetes operator that integrates external secret management systems including AWS SSM, Parameter Store, Hasicorp Vault, 1Password Secrets Automation, etc. It reads values from external vaults and injects values as a Kubernetes Secret"
23+
name = "" # avoid redundant release name in IAM role: ...-ekc-cluster-external-secrets-operator-external-secrets-operator@secrets
24+
description = var.chart_description
2525

26-
repository = "https://charts.external-secrets.io"
27-
chart = "external-secrets"
28-
chart_version = "0.6.0-rc1" # using RC to address this bug https://github.com/external-secrets/external-secrets/issues/1511
26+
repository = var.chart_repository
27+
chart = var.chart
28+
chart_version = var.chart_version
2929
kubernetes_namespace = join("", kubernetes_namespace.default.*.id)
3030
create_namespace = false
3131
wait = var.wait
@@ -68,17 +68,19 @@ module "external_secrets_operator" {
6868
rbac = {
6969
create = var.rbac_enabled
7070
}
71-
})
71+
}),
72+
# additional values
73+
yamlencode(var.chart_values)
7274
])
7375

7476
context = module.this.context
7577
}
7678

7779
module "external_ssm_secrets" {
7880
source = "cloudposse/helm-release/aws"
79-
version = "0.5.0"
81+
version = "0.8.1"
8082

81-
name = "ssm" # avoids hitting length restrictions on IAM Role names
83+
name = "ssm" # distinguish from external_secrets_operator
8284
description = "This Chart uses creates a SecretStore and ExternalSecret to pull variables (under a given path) from AWS SSM Parameter Store into a Kubernetes secret."
8385

8486
chart = "${path.module}/charts/external-ssm-secrets"

src/provider-helm.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ variable "kubeconfig_exec_auth_api_version" {
7979

8080
variable "helm_manifest_experiment_enabled" {
8181
type = bool
82-
default = true
82+
default = false
8383
description = "Enable storing of the rendered manifest for helm_release so the full diff of what is changing can been seen in the plan"
8484
}
8585

src/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ terraform {
1212
}
1313
kubernetes = {
1414
source = "hashicorp/kubernetes"
15-
version = ">= 2.7.1"
15+
version = ">= 2.7.1, != 2.21.0"
1616
}
1717
}
1818
}

0 commit comments

Comments
 (0)