Open baznikin opened 1 year ago
If you omit custom_host_header in resource definition any changes made with web console do not affect terraform apply - provider simply ignores it.
terraform apply
Steps to reproduce:
resource "yandex_cdn_resource" "test" { cname = "cdn-kb.example.com" origin_protocol = "https" origin_group_id = yandex_cdn_origin_group.cdn_kb.id }
No changes. Your infrastructure matches the configuration.
resource "yandex_cdn_resource" "test" { cname = "cdn-kb.example.com" origin_protocol = "https" origin_group_id = yandex_cdn_origin_group.cdn_kb.id options { custom_host_header = "aaa" } }
now terraform apply plan this change:
# yandex_cdn_resource.cdn_kb will be updated in-place ~ resource "yandex_cdn_resource" "test" { id = "bc8tcqvnwrgo3bs6vug3" # (7 unchanged attributes hidden) ~ options { ~ custom_host_header = "sss" -> "aaa" # (20 unchanged attributes hidden) } # (1 unchanged block hidden) }
This issue also persist with terraform import of resource with custom host header:
terraform import
custom_host_header
Issue is actual. Reproduces
This is because of common provider (mis)behavior I mentioned in #465 - if there is no value at all in configuration it completly ignore it and do not try to sync
If you omit custom_host_header in resource definition any changes made with web console do not affect
terraform apply
- provider simply ignores it.Steps to reproduce:
terraform apply
show nothing changed from provider point of view:now
terraform apply
plan this change:This issue also persist with
terraform import
of resource with custom host header:custom_host_header
added to stateterraform apply
do not plan to remove it if there is no custom_host_header option in resource