terraform-provider-yandex icon indicating copy to clipboard operation
terraform-provider-yandex copied to clipboard

Terraform can't really change cdn cname but report that operation done

Open evsasha opened this issue 2 years ago • 2 comments

Terraform can't really change cdn cname but report that operation done.

Provider version: 0.76

Actual result: terraform report that operation completed successfully, bun really nothing happened.

Expected Result:

  1. Terraform return error - cant change cname
  2. Terraform recreate (with destroy) cdn resource.

How to reproduce

  1. Create cdn resource
resource "yandex_cdn_origin_group" "my_group" {
    name = "My Origin group"
    origin {
        source = "ya.ru"
    }
}

resource "yandex_cdn_resource" "my_resource" {
    cname = "test999.yandex-example.ru"
    active = false
    origin_protocol = "https"
    origin_group_id = yandex_cdn_origin_group.my_group.id
}
  1. Try to change cname.
resource "yandex_cdn_resource" "my_resource" {
    cname = "test111.yandex-example.ru"
    active = false
    origin_protocol = "https"
    origin_group_id = yandex_cdn_origin_group.my_group.id
}
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # yandex_cdn_resource.my_resource will be updated in-place
  ~ resource "yandex_cdn_resource" "my_resource" {
      ~ cname           = "test999.yandex-example.ru" -> "test111.yandex-example.ru"
        id              = "bc8mylxizhmcrpvckciq"
        # (6 unchanged attributes hidden)


        # (2 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

yandex_cdn_resource.my_resource: Modifying... [id=bc8mylxizhmcrpvckciq]
yandex_cdn_resource.my_resource: Modifications complete after 1s [id=bc8mylxizhmcrpvckciq]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

evsasha avatar Aug 10 '22 11:08 evsasha