aliyun / terraform-provider-alicloud

Terraform AliCloud provider
https://www.terraform.io/docs/providers/alicloud/
Mozilla Public License 2.0
589 stars 553 forks source link

[alicloud_snat_entry] source_vswitch_id and source_cidr conflict #4484

Open supertom25 opened 2 years ago

supertom25 commented 2 years ago

Hi there,

I found in the latest version when i do plan with resource alicloud_snat_entry, its prompt me to modify the source_cidr since i have no value. from the document, the value source_vswitch_id and source_cidr is fine to insert either one. And in my code, source_vswitch_id is in use.

I try to adding source_cidr and try to resolve but turn out i receive error that both value cannot put at the same time. so now i am stuck and everytime the apply will ask to update the record which not nessary and the resources keep re-create since these values are ForceRenew

1.151.0

Affected Resource(s)

Please list the resources as a list, for example:

Code:

resource "alicloud_snat_entry" "snat-f5-aze" { snat_table_id = "stb-uf677neyixooxxxxxxx" source_vswitch_id = "vsw-uf6hhm2klnxxxxxxxx" snat_ip = "nnn.196.nnn.227" }

Plan:

alicloud_snat_entry.snat-f5-aze must be replaced

-/+ resource "alicloud_snat_entry" "snat-f5-aze" { ~ id = "stb-uf677neyixooxxxxxxx:snat-uf66sujz98m5iaupv8ylx" -> (known after apply) ~ snat_entry_id = "snat-uf66sujz98m5iaupv8ylx" -> (known after apply)

Expected Behavior

No Change

Actual Behavior

Force Replace:

If i put also the "source_cidr", i will got below error: ╷ │ Error: "source_vswitch_id": conflicts with source_cidr │ │ with alicloud_snat_entry.snat-f5-aze, │ on natgw-f5.tf line 10, in resource "alicloud_snat_entry" "snat-f5-aze": │ 10: resource "alicloud_snat_entry" "snat-f5-aze" { │ ╵ ╷ │ Error: "source_cidr": conflicts with source_vswitch_id │ │ with alicloud_snat_entry.snat-f5-aze, │ on natgw-f5.tf line 10, in resource "alicloud_snat_entry" "snat-f5-aze": │ 10: resource "alicloud_snat_entry" "snat-f5-aze" { │ ╵

jonwtech commented 2 years ago

Also affected by this change.

https://github.com/aliyun/terraform-provider-alicloud/commit/8ecba5741d45a13afab9b141c5dbb029dd9cdda4#diff-a915111225e5ae852adc679ec2d1073981f1bd598b856474caa67245ab79a870 - this seems to be the relevant commit.

mosuke5 commented 2 years ago

This issue was fixed with the PR: https://github.com/aliyun/terraform-provider-alicloud/pull/4528/files