diff --git a/huaweicloud/data_source_huaweicloud_dcs_az_v1.go b/huaweicloud/data_source_huaweicloud_dcs_az_v1.go index 926320f5fb..e4f4476b86 100644 --- a/huaweicloud/data_source_huaweicloud_dcs_az_v1.go +++ b/huaweicloud/data_source_huaweicloud_dcs_az_v1.go @@ -67,6 +67,11 @@ func dataSourceDcsAZV1Read(d *schema.ResourceData, meta interface{}) error { if port != "" && newAZ.Port != port { continue } + + code := d.Get("code").(string) + if code != "" && newAZ.Code != code { + continue + } filteredAZs = append(filteredAZs, newAZ) } }