Stub AWS before instance construction
Summary:
Previously, we were stubbing our AWS objects (the ECS resource and EC2
client) after an instance was constructed. This was simpler, but it
prevented us from using our stubbed objects in the launcher's
__init__ function.
Instead, we're now stubbing our AWS objects before the launcher has bee
initialized. Once the fixture is called, any call to boto3.client()
(with any arguments) will return our ecs fixture. Any call to
boto3.resource() (with any arguments) will return our ec2 fixture.
Should we ever make multiple calls to either boto3.client() or
boto3.resource(), we'll need to modify this fixture.
Now, we'll be able to use our stubbed objects inside the launcher's
__init__ - for example, if we wanted to do an invariant check to make
sure something like a cluster or task definition already exists.
Depends on D8638
Test Plan: unit
Reviewers: dgibson, alangenfeld, johann
Reviewed By: dgibson
Differential Revision: https://dagster.phacility.com/D8639