简体   繁体   English

如何使用 terraform 将 EIP 附加到现有的 ENI(在 terraform 之外创建)

[英]How to attach EIP to a existing ENI (Created outside of terraform) using terraform

Hello I'm trying to attach EIP to ENI using terraform. Both EIP and ENI are created outside of terraform.您好,我正在尝试使用 terraform 将 EIP 附加到 ENI。EIP 和 ENI 都是在 terraform 之外创建的。

Following are the manual steps:以下是手动步骤:

  • Need to allocate a IP address in su.net for the ENI ENI需要在su.net中分配一个IP地址
  • Associate EIP to the ENI on the previously allocated IP address.将 EIP 关联到先前分配的 IP 地址上的 ENI。

Is there anyway to automate this using terraform?有没有办法使用 terraform 自动执行此操作?

Found the solution.找到了解决方案。 Looks like terraform natively doesn't support requesting private ip to ENI.看起来 terraform 本机不支持向 ENI 请求私有 ip。 So used data external resource to create a secondary ip to existing ENI and used " aws_eip_association " resource to associate EIP to ENI on Private IP created using data external resource.因此,使用数据外部资源为现有 ENI 创建辅助 ip,并使用“ aws_eip_association ”资源将 EIP 关联到使用数据外部资源创建的私有 IP 上的 ENI。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 CDKTF 创建的 terraform 部署 Lambda? - How to deploy Lambda using terraform created by CDKTF? 如何使用 Terraform 在现有 VPC 中启动 EC - How to launch ECs in an existing VPC using Terraform 如何将标签添加到 ECS 现有服务,使用 Terraform 定义任务 - How to add Tags to ECS existing Service, Task definition using Terraform Terraform CDKTF:如何在现有的 terraform 项目中使用/导入 CDKTF 代码? - Terraform CDKTF: How to use/import CDKTF code in existing terraform project? 如何使用 Terraform 获取新创建的实例 ID - How to get newly created instance id using Terraform 使用 Terraform 模块导入现有 AWS 资源 - Importing existing AWS Resources using Terraform Module 使用 terraform 更新 ALB 中的现有侦听器 - Update the existing listener in ALB using terraform 如何在单独的子目录中将现有资源导入到terraform? - How to import existing resources to terraform in a separate subdirectory? 如何将 ENI 附加到 lambda 以测试与 dynamodb 的可达性? - how to attach ENI to lambda to test reachability to dynamodb? 如何使用多个 eip 和 ec2 实例创建 terraform aws_security_group? - How can I create terraform aws_security_group with multiple eip and ec2 instances?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM