在没有 = 符号的情况下传递 Elastic Beanstalk 配置
Pass Elastic Beanstalk configuration without = sign
所以我尝试使用 terraform 配置模板打开 G1 垃圾收集器:https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elastic_beanstalk_configuration_template#setting
我需要做的就是将 -XX:+UseG1GC 传递给 JVM 选项,但我在名称和值之间插入了一个 = 符号(并且值是必需的)。
如有任何提示,我们将不胜感激!
查看 Elastic Beanstalk 文档 [1],似乎如果您需要传递特定的 JVM 选项,则需要使用该选项作为名称,即:
resource "aws_elastic_beanstalk_configuration_template" "yourappname" {
name = "<yourconfigtemplatename>"
application = "<yourbeanstalkapplicationname>"
setting {
namespace = "aws:elasticbeanstalk:container:tomcat:jvmoptions"
name = "JVM Options"
value = "-XX:+UseG1GC"
}
}
由于我不是 Beanstalk 专家,因此可能需要多次迭代才能使其正确。
编辑:根据 Mark B 的评论,我在值中缺少一个连字符,所以我也添加了它。
所以我尝试使用 terraform 配置模板打开 G1 垃圾收集器:https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elastic_beanstalk_configuration_template#setting
我需要做的就是将 -XX:+UseG1GC 传递给 JVM 选项,但我在名称和值之间插入了一个 = 符号(并且值是必需的)。
如有任何提示,我们将不胜感激!
查看 Elastic Beanstalk 文档 [1],似乎如果您需要传递特定的 JVM 选项,则需要使用该选项作为名称,即:
resource "aws_elastic_beanstalk_configuration_template" "yourappname" {
name = "<yourconfigtemplatename>"
application = "<yourbeanstalkapplicationname>"
setting {
namespace = "aws:elasticbeanstalk:container:tomcat:jvmoptions"
name = "JVM Options"
value = "-XX:+UseG1GC"
}
}
由于我不是 Beanstalk 专家,因此可能需要多次迭代才能使其正确。
编辑:根据 Mark B 的评论,我在值中缺少一个连字符,所以我也添加了它。