创建.ebextensions夹在AWS弹性魔豆 [英] Creation of .ebextensions folder in aws elastic beanstalk
问题描述
我想在AWS上自动缩放触发时部署shellscript里脚本安装程序弹性豆茎。
I am trying to deploy a shellscript script to install a program when autoscaling triggers on aws elastic beanstalk.
我已搜查谷歌和它所有的点,以创建.ebextensions使用配置文件的安装后,启动该程序 可我知道如何创建呢?
I have searched on google and it all points to the creation of .ebextensions to use a config file to install the program upon start up May i know how do i create this?
非常感谢提前帮助
推荐答案
您需要做以下(显然迎合你的需求):
You need to do the following (obviously catering for your requirements):
在你的套装软件的根目录下创建一个文件夹,名为 .ebextensions
In the root on your packaged software create a folder called .ebextensions
drwxr-xr-x 4 root root 4096 Sep 30 13:39 .
dr-xr-x--- 7 root root 4096 Nov 4 15:22 ..
drwxr-xr-x 2 root root 4096 Nov 4 15:22 .ebextensions
在.ebextensions文件夹中创建两个文件,名为 02_files.config 和 03_container_commands.config
In the .ebextensions folder create two files called 02_files.config and 03_container_commands.config
-rw-r--r-- 1 root root 11334 Jul 25 12:26 02_files.config
-rw-r--r-- 1 root root 960 Nov 4 11:22 03_container_commands.config
中的内容 02_files.config 应该包含你的shell脚本的内容:
The contents of 02_files.config should contain the contents of your shell script:
files:
"/path/to/your/shellscript/myscript.sh" :
mode: "000755"
owner: root
group: root
content: |
#!/bin/sh
echo "Hello World!" >> /var/log/myscript.out
中的内容 03_container_commands.config 应包含的命令来运行你的shell脚本:
The contents of 03_container_commands.config should contain the command to run your shell script:
container_commands:
01_runmyshellscript:
command: "/path/to/your/shellscript/myscript.sh"
现在,当您上传您的code将在创建您的shell脚本的 /path/to/your/shellscript/myscript.sh ,然后执行它发送的的Hello World!为 /var/log/myscript.out
Now when you upload your code it will create your shell script in /path/to/your/shellscript/myscript.sh and then execute it sending Hello World! to /var/log/myscript.out
这篇关于创建.ebextensions夹在AWS弹性魔豆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!