本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
带扩展功能的应用程序示例
以下示例演示一个应用程序源包,其中包含 Elastic Beanstalk Amazon Linux 2 和 Amazon Linux 2023 平台支持的多个可扩展性功能:Procfile、.ebextensions 配置文件、自定义挂钩和代理配置文件。
~/my-app/
|-- web.jar
|-- Procfile
|-- readme.md
|-- .ebextensions/
|   |-- options.config        # Option settings
|   `-- cloudwatch.config     # Other .ebextensions sections, for example files and container commands
`-- .platform/
    |-- nginx/                # Proxy configuration
    |   |-- nginx.conf
    |   `-- conf.d/
    |       `-- custom.conf
    |-- hooks/                # Application deployment hooks
    |   |-- prebuild/
    |   |   |-- 01_set_secrets.sh
    |   |   `-- 12_update_permissions.sh
    |   |-- predeploy/
    |   |   `-- 01_some_service_stop.sh
    |   `-- postdeploy/
    |       |-- 01_set_tmp_file_permissions.sh
    |       |-- 50_run_something_after_app_deployment.sh
    |       `-- 99_some_service_start.sh
    `-- confighooks/          # Configuration deployment hooks
        |-- prebuild/
        |   `-- 01_set_secrets.sh
        |-- predeploy/
        |   `-- 01_some_service_stop.sh
        `-- postdeploy/
            |-- 01_run_something_after_config_deployment.sh
            `-- 99_some_service_start.sh注意
Amazon Linux AMI 平台版本(Amazon Linux 2 以前的版本)不支持其中一些扩展。