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个环境变量。

相关推荐
yyuuuzz3 天前
跨境站点日志时区混乱的排查记录
运维·服务器·网络·云计算·aws·1024程序员节
Geek-Chow7 天前
AWS Lambda and Connection-Bound Backends (CloudHSM, Relational Databases)
云计算·aws
无风听海8 天前
AWS CLI的profile
云计算·aws
翼龙云_cloud9 天前
亚马逊云服务器服务代理商:Bedrock 实践经验 Serverless 架构下的 AI 自动化落地
服务器·架构·serverless·云计算·aws
yyuuuzz11 天前
云服务器部署 web 项目的进程常驻记录
运维·服务器·前端·阿里云·云计算·aws
无风听海12 天前
一文读懂 AWS IAM:从工牌、钥匙到统一登录
云计算·aws
Wonopop13 天前
AWS Budgets 预算告警与卡片拒付,为什么不能共用一个“超支“状态?附对账模型与反例测试
云计算·aws·支付系统·对账·mpchat
七牛开发者13 天前
从 AWS 到 OpenRouter,拆解 Agent 模型路由的工程设计
云计算·aws
小七-七牛开发者14 天前
从 AWS 到 OpenRouter,拆解 Agent 模型路由的工程设计
llm·agent·aws·openrouter·codingagent
可达智灵15 天前
堵了门,钥匙还在:一次持续九个月的 AWS 接管修复
云计算·aws·可达智灵