1 個回答
- 最新
- 最多得票
- 最多評論
0
Container overrides need to go into the Parameters
attributes of your Action in your state machine. Here is an example that will retrieve the "foo"
attribute from the input and set it as an environment variable:
{
"States":{
...,
"Manage ECS task":{
"Type":"Task",
"Resource":"arn:aws:states:::ecs:runTask.waitForTaskToken",
"Parameters":{
"LaunchType":"FARGATE",
"Cluster":"cluster-arn",
"TaskDefinition":"job-id",
"Overrides":{
"ContainerOverrides":[
{
"Name":"container-name",
"Environment":[
{
"Name":"FOO_FROM_INPUT",
"Value.$":"$.foo"
}
]
}
]
}
}
}
}
}
If your input supplies the entire value of the "ContainerOverrides"
configuration, then you can do something like this:
{
"States":{
...,
"Manage ECS task":{
"Type":"Task",
"Resource":"arn:aws:states:::ecs:runTask.waitForTaskToken",
"Parameters":{
"LaunchType":"FARGATE",
"Cluster":"cluster-arn",
"TaskDefinition":"job-id",
"Overrides":{
"ContainerOverrides.$": "$.containerOverrides"
}
}
}
}
}
See also Pass State Input as Parameters Using Paths in the Step Functions documentation.
相關內容
- AWS 官方已更新 4 年前
- AWS 官方已更新 2 年前