IMAP-Science-Operations-Center / sds-data-manager

MIT License
0 stars 14 forks source link

I-ALIRT: Put ECS in different Availability Zones #390

Open laspsandoval opened 1 week ago

laspsandoval commented 1 week ago

Summary

I think that I just need to do this:

ecs_service = ecs.Ec2Service( self, "MyService1", cluster=ecs_cluster, task_definition=task_definition, desired_count=1, placement_constraints=[ ecs.PlacementConstraint.distinct_instances(), ], placement_strategies=[ ecs.PlacementStrategy.spread_across(ecs.BuiltInAttributes.AVAILABILITY_ZONE) ], )

Tasks for this service will always be placed on a different EC2 instance from tasks of any other service using the same constraint.

This will require some testing, but should be pretty easy to implement.

Requirements

The more specific the better.

Related tickets

No response