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

Private zone - Update DNS Record if IP change failed #54

Closed
But4ler opened this issue Dec 11, 2018 · 0 comments · Fixed by #87
Closed

Private zone - Update DNS Record if IP change failed #54

But4ler opened this issue Dec 11, 2018 · 0 comments · Fixed by #87
Assignees

Comments

@But4ler
Copy link

But4ler commented Dec 11, 2018

Hi there,

Currently, if we update a DNS record after an instance re-creation for example, there is a conflict because the FQDN already exists, and the IP to be changed

Terraform Version

Terraform v0.11.10

  • provider.flexibleengine v1.2.1
  • provider.huaweicloud v1.2.0
  • provider.template v1.0.0

Affected Resource(s)

  • huaweicloud_dns_recordset_v2

Terraform Configuration Files

resource "huaweicloud_dns_recordset_v2" "ecs_arti_app01" {
  zone_id = "${var.dns_zone_id}"
  name = "${flexibleengine_compute_instance_v2.ecs_arti_app01.name}.local."
  ttl = 3600
  type = "A"
  records = ["${flexibleengine_compute_instance_v2.ecs_arti_app01.access_ip_v4}"]
}
-/+ flexibleengine_compute_instance_v2.ecs_arti_app01 (new resource required)
      id:                        "6bcac7fe-be6f-4c93-baf7-c9b3678eaf0c" => <computed> (forces new resource)
      access_ip_v4:              "192.168.0.43" => <computed>
      access_ip_v6:              "" => <computed>
      all_metadata.%:            "0" => <computed>
      availability_zone:         "eu-west-0b" => "eu-west-0b"
      flavor_id:                 "s3.xlarge.2" => <computed>
      flavor_name:               "s3.xlarge.2" => "s3.xlarge.2"
      image_id:                  "d9bd237a-c298-47a7-aca8-3664e3debb44" => <computed>
      image_name:                "OBS_U_Ubuntu_16.04" => "OBS_U_Ubuntu_16.04"
      key_pair:                  "keypair_ansible" => "keypair-xnrqxx24" (forces new resource)
      name:                      "dt-artiextapp-z01fe-prp" => "dt-artiextapp-z01fe-prp"
      network.#:                 "1" => "1"
      network.0.access_network:  "false" => "false"
      network.0.fixed_ip_v4:     "192.168.0.43" => <computed>
      network.0.fixed_ip_v6:     "" => <computed>
      network.0.floating_ip:     "" => <computed>
      network.0.mac:             "fa:16:3e:b5:86:88" => <computed>
      network.0.name:            "14bce6dd-a2ce-4402-99af-a4905bfb18bf" => <computed>
      network.0.port:            "" => <computed>
      network.0.uuid:            "33e2e14a-288c-4068-83f9-9d9a664fa4" => "33e2e14a-288c-4068-83f9-9d9a664fa4"
      region:                    "eu-west-0" => <computed>
      security_groups.#:         "1" => "1"
      security_groups.584365606: "secgroup_artifactory_prp" => "secgroup_artifactory_prp"
      stop_before_destroy:       "false" => "false"


  ~ huaweicloud_dns_recordset_v2.ecs_arti_app01
      records.#:                 "1" => <computed>

Debug Output

[DEBUG] plugin.terraform-provider-huaweicloud_v1.2.0_x4: 2018/12/11 14:58:01 [DEBUG] Create Options: huaweicloud.RecordSetCreateOpts{CreateOpts:recordsets.CreateOpts{Name:"dt-artiextapp-z01fe-prp.local.", Description:"", Records:[]string{"192.168.0.194"}, TTL:3600, Type:"A"}, ValueSpecs:map[string]string{}}
...
[DEBUG] plugin.terraform-provider-huaweicloud_v1.2.0_x4: 2018/12/11 14:58:01 [DEBUG] HuaweiCloud Request Body: {
[DEBUG] plugin.terraform-provider-huaweicloud_v1.2.0_x4: "name": "dt-artiextapp-z01fe-prp.local.",
[DEBUG] plugin.terraform-provider-huaweicloud_v1.2.0_x4: "records": [
[DEBUG] plugin.terraform-provider-huaweicloud_v1.2.0_x4: "192.168.0.194"
[DEBUG] plugin.terraform-provider-huaweicloud_v1.2.0_x4: ],
[DEBUG] plugin.terraform-provider-huaweicloud_v1.2.0_x4: "ttl": 3600,
[DEBUG] plugin.terraform-provider-huaweicloud_v1.2.0_x4: "type": "A"
[DEBUG] plugin.terraform-provider-huaweicloud_v1.2.0_x4: }
[DEBUG] plugin.terraform-provider-huaweicloud_v1.2.0_x4: 2018/12/11 14:58:01 [DEBUG] Openstack Response Code: 400
[DEBUG] plugin.terraform-provider-huaweicloud_v1.2.0_x4: 2018/12/11 14:58:01 [DEBUG] Openstack Response Headers:
[DEBUG] plugin.terraform-provider-huaweicloud_v1.2.0_x4: Content-Length: 117
[DEBUG] plugin.terraform-provider-huaweicloud_v1.2.0_x4: Content-Type: application/json
[DEBUG] plugin.terraform-provider-huaweicloud_v1.2.0_x4: Date: Tue, 11 Dec 2018 13:58:11 GMT
[DEBUG] plugin.terraform-provider-huaweicloud_v1.2.0_x4: Request_id: 75c2c0a7-9032-4d23-8750-89ee06a03624
[DEBUG] plugin.terraform-provider-huaweicloud_v1.2.0_x4: Set-Cookie: ***
[DEBUG] plugin.terraform-provider-huaweicloud_v1.2.0_x4: 2018/12/11 14:58:01 [DEBUG] HuaweiCloud Response Body: {
[DEBUG] plugin.terraform-provider-huaweicloud_v1.2.0_x4: "code": "DNS.0312",
[DEBUG] plugin.terraform-provider-huaweicloud_v1.2.0_x4: "message": "Attribute 'name' conflicts with Record Set 'dt-artiextapp-z01fe-prp.local.' type 'A'."
[DEBUG] plugin.terraform-provider-huaweicloud_v1.2.0_x4: }

Expected Behavior

Recréation ou update de de l’enregistrement DNS

Actual Behavior

nothing, error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants