Skip to content

Commit

Permalink
OPS-5263 Add support for multiple records and description
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncolincap committed Oct 11, 2023
1 parent 95c9765 commit f4be556
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion modules/opentelekomcloud-csv-to-dns/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ resource "opentelekomcloud_dns_recordset_v2" "records" {
ttl = 300
type = each.value.type
# txt records have a max length of 255 characters
records = [replace(each.value.record, "/(.{255})/", "$1\" \"")]
records = [ for record in split("|", each.value.record) : replace(record, "/(.{255})/", "$1\" \"")]
description = each.value.description

lifecycle {
ignore_changes = [zone_id]
Expand Down
2 changes: 1 addition & 1 deletion modules/opentelekomcloud-csv-to-dns/variables.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
variable "csv_file_path" {
type = string
description = "Path to the CSV file containing the records to create, expected fields are domain, type and record."
description = "Path to the CSV file containing the records to create, expected fields are domain, type, record and description (can be empty). Multiple records can be separated using a pipe (|) character."
}

variable "zone_id" {
Expand Down

0 comments on commit f4be556

Please sign in to comment.