Skip to content

Commit 551e673

Browse files
authored
fix: Minor adjustments to some variable descriptions (#98)
1 parent cc9d2b0 commit 551e673

File tree

6 files changed

+21
-19
lines changed

6 files changed

+21
-19
lines changed

.secrets.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "go.sum|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2023-04-05T23:25:49Z",
6+
"generated_at": "2023-04-06T21:27:25Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ No modules.
124124
|------|-------------|------|---------|:--------:|
125125
| <a name="input_cluster_id"></a> [cluster\_id](#input\_cluster\_id) | Cluster id to add to agents to | `string` | n/a | yes |
126126
| <a name="input_cluster_resource_group_id"></a> [cluster\_resource\_group\_id](#input\_cluster\_resource\_group\_id) | Resource group of the cluster | `string` | n/a | yes |
127-
| <a name="input_logdna_add_cluster_name"></a> [logdna\_add\_cluster\_name](#input\_logdna\_add\_cluster\_name) | Add cluster name to the list of tags | `bool` | `true` | no |
127+
| <a name="input_logdna_add_cluster_name"></a> [logdna\_add\_cluster\_name](#input\_logdna\_add\_cluster\_name) | If true, configure the logdna agent to attach a tag containing the cluster name to all log messages. | `bool` | `true` | no |
128128
| <a name="input_logdna_agent_tags"></a> [logdna\_agent\_tags](#input\_logdna\_agent\_tags) | array of tags to group the host logs pushed by the logdna agent | `list(string)` | `[]` | no |
129129
| <a name="input_logdna_agent_version"></a> [logdna\_agent\_version](#input\_logdna\_agent\_version) | Version of the agent to deploy. To lookup version run: `ibmcloud cr images --restrict ext/logdna-agent`. If null, the default value is used. | `string` | `"3.8.0-20230206.cbc937fa5513f636"` | no |
130130
| <a name="input_logdna_enabled"></a> [logdna\_enabled](#input\_logdna\_enabled) | Deploy IBM Cloud Logging agent | `bool` | `true` | no |

examples/basic/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ resource "time_sleep" "wait_operators" {
9595
# Observability Agents
9696
##############################################################################
9797

98+
9899
module "observability_agents" {
99100
source = "../.."
100101
depends_on = [time_sleep.wait_operators]

main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
##############################################################################
22
# observability-agents-module
33
#
4-
# Module Description
54
##############################################################################
65

76
data "ibm_container_vpc_cluster" "cluster" {
@@ -42,17 +41,18 @@ data "ibm_resource_instance" "sysdig_instance" {
4241
}
4342

4443
locals {
45-
logdna_secret_name = "logdna-agent" #checkov:skip=CKV_SECRET_6
44+
logdna_secret_name = "logdna-agent" #checkov:skip=CKV_SECRET_6
45+
# Not publically documented in provider. See https://github.com/IBM-Cloud/terraform-provider-ibm/issues/4485
4646
cluster_name = data.ibm_container_vpc_cluster.cluster.resource_name
4747
logdna_chart_location = "${path.module}/chart/logdna-agent"
4848
logdna_resource_group_id = var.logdna_resource_group_id != null ? var.logdna_resource_group_id : var.cluster_resource_group_id
4949
logdna_agent_namespace = "ibm-observe"
5050
logdna_agent_registry = "icr.io/ext/logdna-agent"
5151
logdna_key_validate_condition = var.logdna_enabled == true && var.logdna_ingestion_key == null
5252
logdna_key_validate_msg = "Values for 'logdna_ingestion_key' variables must be passed when 'logdna_enabled = true'"
53-
logdna_agent_tags = var.logdna_add_cluster_name ? join("\\,", concat(var.logdna_agent_tags, formatlist(local.cluster_name))) : join("\\,", var.logdna_agent_tags)
5453
# tflint-ignore: terraform_unused_declarations
5554
logdna_key_validate_check = regex("^${local.logdna_key_validate_msg}$", (!local.logdna_key_validate_condition ? local.logdna_key_validate_msg : ""))
55+
logdna_agent_tags = var.logdna_add_cluster_name ? concat([local.cluster_name], var.logdna_agent_tags) : var.logdna_agent_tags
5656
sysdig_chart_location = "${path.module}/chart/sysdig-agent"
5757
sysdig_resource_group_id = var.sysdig_resource_group_id != null ? var.sysdig_resource_group_id : var.cluster_resource_group_id
5858
sysdig_agent_registry = "icr.io/ext/sysdig/agent"
@@ -104,7 +104,7 @@ resource "helm_release" "logdna_agent" {
104104
set {
105105
name = "agent.tags"
106106
type = "string"
107-
value = local.logdna_agent_tags
107+
value = join("\\,", local.logdna_agent_tags)
108108
}
109109

110110
provisioner "local-exec" {

module-metadata.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@
3838
"logdna_add_cluster_name": {
3939
"name": "logdna_add_cluster_name",
4040
"type": "bool",
41-
"description": "Add cluster name to the list of tags",
41+
"description": "If true, configure the logdna agent to attach a tag containing the cluster name to all log messages.",
4242
"default": true,
4343
"pos": {
4444
"filename": "variables.tf",
45-
"line": 55
45+
"line": 56
4646
}
4747
},
4848
"logdna_agent_tags": {
@@ -89,7 +89,7 @@
8989
],
9090
"pos": {
9191
"filename": "variables.tf",
92-
"line": 48
92+
"line": 49
9393
}
9494
},
9595
"logdna_instance_name": {
@@ -124,7 +124,7 @@
124124
],
125125
"pos": {
126126
"filename": "variables.tf",
127-
"line": 87
127+
"line": 88
128128
}
129129
},
130130
"sysdig_agent_version": {
@@ -134,7 +134,7 @@
134134
"default": "12.10.1",
135135
"pos": {
136136
"filename": "variables.tf",
137-
"line": 79
137+
"line": 80
138138
}
139139
},
140140
"sysdig_enabled": {
@@ -148,7 +148,7 @@
148148
],
149149
"pos": {
150150
"filename": "variables.tf",
151-
"line": 61
151+
"line": 62
152152
}
153153
},
154154
"sysdig_instance_name": {
@@ -161,7 +161,7 @@
161161
],
162162
"pos": {
163163
"filename": "variables.tf",
164-
"line": 67
164+
"line": 68
165165
}
166166
},
167167
"sysdig_resource_group_id": {
@@ -170,7 +170,7 @@
170170
"description": "Resource group that the IBM Cloud Monitoring is in. Defaults to Clusters group",
171171
"pos": {
172172
"filename": "variables.tf",
173-
"line": 73
173+
"line": 74
174174
}
175175
}
176176
},
@@ -238,7 +238,7 @@
238238
},
239239
"pos": {
240240
"filename": "main.tf",
241-
"line": 12
241+
"line": 11
242242
}
243243
},
244244
"data.ibm_container_vpc_cluster.cluster": {
@@ -254,7 +254,7 @@
254254
},
255255
"pos": {
256256
"filename": "main.tf",
257-
"line": 7
257+
"line": 6
258258
}
259259
},
260260
"data.ibm_resource_instance.logdna_instance": {
@@ -271,7 +271,7 @@
271271
},
272272
"pos": {
273273
"filename": "main.tf",
274-
"line": 28
274+
"line": 27
275275
}
276276
},
277277
"data.ibm_resource_instance.sysdig_instance": {
@@ -288,7 +288,7 @@
288288
},
289289
"pos": {
290290
"filename": "main.tf",
291-
"line": 36
291+
"line": 35
292292
}
293293
}
294294
},

variables.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ variable "logdna_agent_tags" {
4343
type = list(string)
4444
description = "array of tags to group the host logs pushed by the logdna agent"
4545
default = []
46+
nullable = false
4647
}
4748

4849
variable "logdna_ingestion_key" {
@@ -54,7 +55,7 @@ variable "logdna_ingestion_key" {
5455

5556
variable "logdna_add_cluster_name" {
5657
type = bool
57-
description = "Add cluster name to the list of tags"
58+
description = "If true, configure the logdna agent to attach a tag containing the cluster name to all log messages."
5859
default = true
5960
}
6061

0 commit comments

Comments
 (0)