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

alicloud_ots_instance_attachment with multiple vswitches doesn't work as expected #7587

Open
maros7 opened this issue Aug 23, 2024 · 0 comments

Comments

@maros7
Copy link

maros7 commented Aug 23, 2024

Terraform Version

1.9.5

Affected Resource(s)

alicloud_ots_instance_attachment

Terraform Configuration Files

resource "alicloud_ots_instance_attachment" "ots_instance_attachments" {
  for_each      = local.vswitches
  instance_name = alicloud_ots_instance.ots_instance.name
  vpc_name      = format("az%s", substr(each.value.zone_id, length(each.value.zone_id) - 1, 1))
  vswitch_id    = each.key
}

Debug Output

N/A

Panic Output

N/A

Expected Behavior

Create one attachment per vswitch.

Actual Behavior

While it does create it, any subsequent run wants to destroy and create one of them again (in the case of 2 vswitches). This is due to the fact that you always fetch the first VpcInfo when describing the current state. This commit would fix this issue 574b174.

Steps to Reproduce

Use code similar to above.

Important Factoids

References

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

No branches or pull requests

1 participant