我有一个启动 Elastic Beanstalk 服务的 CloudFormation 模板。我想在模板中将健康检查 URL 设置为 /health
。
JSON 中的约定是什么?
最佳答案
您需要设置 AWS::ElasticBeanstalk::Environment
的 OptionSettings
属性:
例如:
{
"Type" : "AWS::ElasticBeanstalk::Environment",
"Properties" : {
"ApplicationName" : { "Ref" : "sampleApplication" },
"Description" : "AWS Elastic Beanstalk Environment running PHP Sample Application",
"VersionLabel" : "Initial Version",
"OptionSettings" : [
{
"Namespace" : "elasticbeanstalk:application",
"OptionName" : "Application Healthcheck URL",
"Value" : "/health"
}
],
"TemplateName" : "DefaultConfiguration",
}
}
在此示例中,选项应用程序运行状况检查 URL
设置为 /health
更多信息请参见:
关于amazon-web-services - 如何在 AWS CloudFormation 模板中的 Elastic Beanstalk 实例上设置运行状况检查 URL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47753168/