我有两个环境AWS Elastic Beanstalk:Development和Production.
我希望这.ebextensions/app.config只能在Production环境中运行.有什么办法吗?
的app.config:
container_commands:
01-command:
command: "crontab .ebextensions/cronjob"
leader_only: true
Run Code Online (Sandbox Code Playgroud) 我有一个spring-boot应用程序,我需要指定石墨服务器和端口(发送指标).要做到这一点,我必须安装和配置statsd.我这样做是使用该ebextensions文件.
commands:
01_nodejs_install:
command: sudo yum -y install nodejs npm --enablerepo=epel
ignoreErrors: true
02_mkdir_statsd:
command: mkdir /home/ec2-user/statsd
ignoreErrors: true
03_fetch_statsd:
command: git clone https://github.com/etsy/statsd.git /home/ec2-user/statsd
ignoreErrors: true
04_change_example_config:
command: "cat exampleConfig.js | sed 's/2003/<graphite-port>/g' | sed 's/graphite.example.com/<my-graphite-server>/g' > config.js"
cwd: /home/ec2-user/statsd
05_run_statsd:
command: setsid node stats.js config.js >/dev/null 2>&1 < /dev/null &
cwd: /home/ec2-user/statsd
Run Code Online (Sandbox Code Playgroud)
这种配置的问题是我可以在这里为所有环境仅指定1个石墨服务器.
所以我决定将命令04和05移入container_commands.我想定义叫做环境变量的ENV_NAME 使用魔豆控制台/ UI,并将其设置为dev,qa或prod根据环境.然后我可以使用test选项container_commands仅基于此特定环境运行04和05命令ENV_NAME.
所以我的问题是 - …
java environment-variables amazon-web-services amazon-elastic-beanstalk ebextensions
我有两个独立的环境来管理我的应用程序,一个主env,一个带有负载均衡器的web服务器,一个辅助env,一个运行crons的小型层工作者.
我的.ebextensions包含很多实例和负载均衡器配置,例如:
01 amazon.config
Resources:
# LB SG
AWSEBLoadBalancerSecurityGroup:
Type: "AWS::EC2::SecurityGroup"
Properties:
....
Run Code Online (Sandbox Code Playgroud)
当我通过eb deploy worker-env部署到我的worker实例时,有没有办法忽略这个单个文件
如果文件未被忽略,则由于工作人员没有负载均衡器而导致错误.