Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ops 5263 integrate email dns records in terraform #8

Merged
merged 8 commits into from
Oct 12, 2023
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