AWS EB中通过代码方式给EC2添加环境变量

问题

需要通过代码方式从EB给EC2添加环境变量:

bash 复制代码
.ebextensions
	-04environment-variables.config

04environment-variables.config

yaml 复制代码
files:
  "/etc/profile.d/environment_variables.sh":
    mode: "000755"
    owner: root
    group: root
    content: |
      #!/bin/bash
      export TZ="Asia/Shanghai"
      export TESSDATA_PREFIX="/usr/share/tesseract/tessdata"
      export TMOUT="1800"

container_commands:
    environment_variables:
      command: |
        source /etc/profile
      ignoreErrors: true

这里设置了3个环境变量。

相关推荐
2601_967980112 天前
Python 与云计算:AWS、GCP、Azure 实践
python·云计算·azure·aws·gcp
humcomm5 天前
设计与架构 · 01 sidecar 会消失吗:从 Istio ambient GA 到 AWS App Mesh 关停,一次服务网格数据面的重新洗牌
架构·istio·aws
2601_967980116 天前
win10如何把python加入环境变量
python·win10·安装教程·命令行·环境变量
Zhang28573213 天前
跨境业务选AWS区域避坑指南:美东、美西、新加坡、东京怎么选?
云计算·aws
yunlaodacom14 天前
AWS亚马逊云代理商:WAF登录接口请求洪泛,限速阈值怎么设置?
云计算·aws
知识搬运临时工19 天前
一个模板把 AEM 拖进 Full GC 死亡螺旋:300% CPU、7 GB 堆、310 万行堆栈
java·aws
yyuuuzz19 天前
云服务器安全组规则优先级的机制记录
运维·服务器·网络·安全·阿里云·aws
yyuuuzz23 天前
跨境站点日志时区混乱的排查记录
运维·服务器·网络·云计算·aws·1024程序员节
Geek-Chow1 个月前
AWS Lambda and Connection-Bound Backends (CloudHSM, Relational Databases)
云计算·aws
无风听海1 个月前
AWS CLI的profile
云计算·aws