忽略4xx增强健康规则会导致AWS EB控制台配置页面错误

时间:2018-08-03 02:27:55

标签: amazon-web-services elastic-beanstalk amazon-elastic-beanstalk

按照Configuring Enhanced Health Rules Using a Config Document上的说明使用“ .ebextensions / YAML / JSON”方法忽略应用程序HTTP 4xx错误,特别是,以下内容已添加到“ .ebextensions / 00_option_settings.config”:

  - namespace: aws:elasticbeanstalk:healthreporting:system
    option_name: ConfigDocument
    value: {
      "Rules": {
        "Environment": {
          "Application": {
            "ApplicationRequests4xx": {
              "Enabled": false
            }
          }
        }
      },
      "Version": 1
    }

使用此配置,可以成功部署到弹性beantalk,并且似乎达到了预期的效果,但是随后在EB控制台中访问环境的“配置”页面(即“ https://console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/environment/dashboard?applicationName=my-app&environmentId=e-12345678”)时,发生错误:< / p>

enter image description here

我尝试引用/转义YAML中嵌入的JSON,但没有效果。

在命令行中,eb config可以正常运行:

  aws:elasticbeanstalk:healthreporting:system:
    ConfigDocument: '{"Version":1,"Rules":{"Environment":{"Application":{"ApplicationRequests4xx":{"Enabled":false}}}}}'
    HealthCheckSuccessThreshold: Ok
    SystemType: enhanced

1 个答案:

答案 0 :(得分:1)

我的看起来像这样,并且工作正常。

option_settings:
  - namespace: aws:elasticbeanstalk:healthreporting:system
    option_name: ConfigDocument
    value: {"Rules": {"Environment": {"Application": {"ApplicationRequests4xx": {"Enabled": false}}}},"Version": 1}