I'm trying to create an ECS task definition as part of a CloudFormation stack.
My task definition so far looks like this...
TaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties:
RequiresCompatibilities:
- EC2
ExecutionRoleArn: !Ref MyTaskRole
ContainerDefinitions:
- Name: !Ref ServiceName
Image: amazon/amazon-ecs-sample
PortMappings:
- ContainerPort: 3000
HostPort: 0
Protocol: tcp
MemoryReservation: 128
When I try to run this, I get the following error...
#/ContainerDefinitions/0/MemoryReservation: expected type: Number, found: String
So it seems that CloudFormation is converting 128 to a string, and then the stack fails.
What is the correct way to define this value so that it remains a number?