AWS ECS 任务定义中环境变量的端口映射

时间:2021-05-19 07:37:42

标签: amazon-web-services amazon-ecs ecs-taskdefinition

有没有办法从 AWS ECS 任务定义中的环境变量中指定容器端口?

这是在我的 task-definition.json 中,由 Github Actions 使用

"containerDefinitions": [
    {
        "portMappings": [
            {
                "containerPort": 3037  <=== Can this come from environment variable defined below?
            }
        ],
        "essential": true,
        "environment": [
            {
                "name": "PORT",
                "value": "3037"
            }
        ]
    }
],
"requiresCompatibilities": ["EC2"]

0 个答案:

没有答案