小编Ben*_*67b的帖子

Github actions - 传递秘密变量来渲染 ECS 任务定义操作

为了将新任务部署到 ECS,我使用amazon-ecs-render-task-definition GitHub 操作。此操作接收 task-definition.json 作为参数。这个 JSON 包含我不想推送的秘密,有没有办法向这个 JSON 注入一些参数?也许来自 aws Secret Manager?

例如 -任务定义.json

{
 "containerDefinitions": [
  {
   "name": "wordpress",
   "links": [
     "mysql"
   ],
  "image": "wordpress",
  "essential": true,
  "portMappings": [
    {
      "containerPort": 80,
      "hostPort": 80
    }
  ],
  "memory": 500,
  "cpu": 10
},
{
  "environment": [
    {
      "name": "MYSQL_ROOT_PASSWORD",
      "value": ****"password"**** // ITS A SECRET!
    }
  ],
  "name": "mysql",
  "image": "mysql",
  "cpu": 10,
  "memory": 500,
  "essential": true
}], 
 "family": "hello_world" }
Run Code Online (Sandbox Code Playgroud)

amazon-web-services amazon-ecs github-actions

4
推荐指数
2
解决办法
2745
查看次数