我正在尝试在 ECS 任务中设置几个环境变量,但是这些变量似乎从未被传递(也没有引发任何错误)。
这个功能坏了吗?我已经尝试了很多次,但似乎没有任何效果。
使用:Ansible v2.9.6 aws-cli v1.16.162 Python v2.7.5
例如
- name: Create task def
ecs_taskdefinition:
revision: 1
launch_type: FARGATE
cpu: 256
memory: 512
network_mode: awsvpc
state: present
family: simpsons
execution_role_arn: "arn:aws:iam::XXXXXXXXXXXXXX:role/ecsTaskExecutionRole"
region: "{{ aws_region }}"
aws_access_key: "{{ ecs_access_key }}"
aws_secret_key: "{{ ecs_secret_key }}"
containers:
- name: "{{ maven_artifact_id }}"
image: "XXXXXXXXXXXXXX.dkr.ecr.eu-west-1.amazonaws.com/REPO:TAG"
environment:
- name: "PORT"
value: "443"
essential: true
logConfiguration:
logDriver: "awslogs"
options:
awslogs-group: "/ecs/test-cluster-taskdef"
awslogs-region: "us-west-2"
awslogs-stream-prefix: "ecs"