1 Antwort
- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
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.
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor 3 Jahren
- AWS OFFICIALAktualisiert vor 4 Jahren