Terraform 和 ElasticBeanstalk。当 EC2 由 elasticbeanstalk 启动时,如何在 EC2 中安装 EFS?
Terraform and ElasticBeanstalk. How do I mount a EFS in EC2 when EC2 is spun up by elasticbeanstalk?
简而言之,我们正在使用 Terraform 来管理我们的 elasticbeanstalk 环境。我需要由 elasticbeanstalk 启动的 ec2 来安装我们的 EFS 以及后续的 EC2 在由 elasticbeanstalk 启动时必须安装相同的 EFS。
我追求remote-exec 的选项,但不知道如何在elasticbeanstalk 中使用它。看来我需要一个 aws_instance 来定位 EC2 以执行挂载命令。这是我没有的,因为 beantalk 为我做了。 None 我能找到的 elasticbeanstalk 设置允许挂载 EFS 或在 EC2 中执行远程代码。
我也在寻找一个潜在的配置文件解决方案,我可以在其中指定安装但没有运气。
任何人都可以指出正确的方向来解决这个问题吗?
您不会直接为此使用 TF。相反,您应该使用 .ebextensions for your application. Thus you would have to add .ebextensions
to your application and provide code (bash script) that executes the mount operation, e.g. in container_commands.
简而言之,我们正在使用 Terraform 来管理我们的 elasticbeanstalk 环境。我需要由 elasticbeanstalk 启动的 ec2 来安装我们的 EFS 以及后续的 EC2 在由 elasticbeanstalk 启动时必须安装相同的 EFS。
我追求remote-exec 的选项,但不知道如何在elasticbeanstalk 中使用它。看来我需要一个 aws_instance 来定位 EC2 以执行挂载命令。这是我没有的,因为 beantalk 为我做了。 None 我能找到的 elasticbeanstalk 设置允许挂载 EFS 或在 EC2 中执行远程代码。
我也在寻找一个潜在的配置文件解决方案,我可以在其中指定安装但没有运气。
任何人都可以指出正确的方向来解决这个问题吗?
您不会直接为此使用 TF。相反,您应该使用 .ebextensions for your application. Thus you would have to add .ebextensions
to your application and provide code (bash script) that executes the mount operation, e.g. in container_commands.