-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(setup): pass fields via Terraform variable
- Loading branch information
Showing
28 changed files
with
431 additions
and
1,790 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,13 @@ | ||
{{- range $value := .Values.sumologic.logs.fields }} | ||
resource "sumologic_field" {{ $value | quote }} { | ||
count = var.create_fields ? 1 : 0 | ||
resource "sumologic_field" "collection_field" { | ||
for_each = var.create_fields ? toset(var.fields) : toset([]) | ||
|
||
lifecycle { | ||
# ignore changes for name and type, as older installations have been case sensitive | ||
# see: https://github.com/SumoLogic/sumologic-kubernetes-collection/issues/2865 | ||
ignore_changes = [field_name, data_type] | ||
} | ||
|
||
field_name = {{ $value | quote }} | ||
field_name = "${ each.key }" | ||
data_type = "String" | ||
state = "Enabled" | ||
} | ||
{{- end }} | ||
|
||
{{- range $value := .Values.sumologic.logs.additionalFields }} | ||
resource "sumologic_field" {{ $value | quote }} { | ||
count = var.create_fields ? 1 : 0 | ||
|
||
lifecycle { | ||
# ignore changes for name and type, as older installations have been case sensitive | ||
# see: https://github.com/SumoLogic/sumologic-kubernetes-collection/issues/2865 | ||
ignore_changes = [field_name, data_type] | ||
} | ||
|
||
field_name = {{ $value | quote }} | ||
data_type = "String" | ||
state = "Enabled" | ||
} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{{- $fields := concat .Values.sumologic.logs.fields .Values.sumologic.logs.additionalFields -}} | ||
{{- $variables := dict "fields" $fields -}} | ||
{{- toPrettyJson $variables | nindent 2 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.