首页 > 解决方案 > AWS MWAA:某些提供的配置没有预期的格式:调度程序,例如:core.log_format

问题描述

我正在 AWS 中部署 Managed Airflow (MWAA) 并在 cloudformation 中收到以下错误。我给出的 log_format 与气流文档中提到的相同,但 CFN 仍然给出错误。

资源处理程序返回消息:“提供的请求无效:某些提供的配置没有预期的格式:调度程序,例如:core.log_format。(服务:Mwaa,状态代码:400,HandlerErrorCode:InvalidRequest)

以下是我在 cloudformation 中提供的 Airflow 配置选项。

     AirflowConfigurationOptions:
        core:
          parallelism: 64
          default_task_retries: 3
          default_timezone: Australia/Melbourne
          dag_concurrency: 16
          maximum_active_runs_per_dag: 16
          load_examples: False
          load_default_connections: False
          log_format: "[%%(asctime)s] {{%%(filename)s:%%(lineno)d}} %%(levelname)s - %%(message)s"
        webserver:
          default_ui_timezone: Australia/Melbourne
        scheduler:
          catchup_by_default: False
          allow_trigger_in_future: True
        operators:
          default_owner: vulcan
        smart_sensor:
          use_smart_sensor: True
          shards: 8
        logging:
          remote_logging: True
          remote_log_conn_id: s3
          remote_base_log_folder:
            - Fn::ImportValue: xxxxx

标签: amazon-web-servicesairflowmwaa

解决方案


在 CFN 中提及气流配置的正确方法是:

  env:
    Type: AWS::MWAA::Environment
    Properties:
      AirflowConfigurationOptions:
        core.parallelism: 64
        core.default_task_retries: 3
        core.default_timezone: Australia/Melbourne

并且应该首先使用 AWS Secret manager 创建远程登录连接,然后可以在 cfn 中的远程日志记录气流配置中使用它。


推荐阅读