Skip to content

Commit

Permalink
Ops 5263 integrate email dns records in terraform (#8)
Browse files Browse the repository at this point in the history
* OPS-5263 Added opentelekomcloud-csv-to-dns module

* terraform-docs: automated action

* OPS-5263 Comments from review

* terraform-docs: automated action

* OPS-5263 Add support for multiple records and description

* terraform-docs: automated action

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
simoncolincap and github-actions[bot] authored Oct 12, 2023
1 parent 6ca3d9f commit 643ef7f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/opentelekomcloud-csv-to-dns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_csv_file_path"></a> [csv\_file\_path](#input\_csv\_file\_path) | Path to the CSV file containing the records to create, expected fields are domain, type and record. | `string` | n/a | yes |
| <a name="input_csv_file_path"></a> [csv\_file\_path](#input\_csv\_file\_path) | 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. | `string` | n/a | yes |
| <a name="input_zone_id"></a> [zone\_id](#input\_zone\_id) | OTC DNS zone ID. | `string` | n/a | yes |
## Outputs

Expand Down
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 643ef7f

Please sign in to comment.