在 terraform 中分离弹性 IP

Dissociate Elastic IP in terraform

我正在通过 terraform 文档检查两件我找不到的东西。

  1. 取消弹性 IP 与现有 EC2 的关联,以便可以将其分配给更新的实例。
  2. 正在从 EBS 卷 ID 获取 EC2 实例附件信息。

请告诉我以上两个功能是否存在于 terraform 中,或者有其他方法可以获取以上信息。是否可以请求将此类功能添加到任何地方的 Terraform。

Disassociating an elastic IP from an existing EC2 so that it can be assigned to a newer instance.

要创建关联,您必须使用 aws_eip_association。随后,要删除关联,请从您的 TF 代码中删除 aws_eip_association

Getting the EC2 instance attachment information the its volume id.

不支持。您可以开发自己的 external data source 来获取您想要的任何信息,而 TF 不直接支持这些信息。

Can such features be requested to be added to terraform anywhere.

是的,您可以在 github 上制作 Issueshttps://github.com/hashicorp/terraform-provider-aws