https://pulumi.com logo
#typescript
Title
# typescript
p

purple-shampoo-2675

05/03/2022, 3:08 PM
Hello! I have a slightly niche problem. I'm using
awsx
to deploy EC2-backed ECS services (not Fargate_)_ and having trouble setting them up with proper capacity providers. They have an ASG (via
cluster.createAutoScalingGroup(...)
) but by default the group doesn't scale for new deploys. I thought the answer might be to create an explicit
aws.ecs.CapacityProvider
which will respond to task placement failures by provisioning new instances, but there seems to be a circular dependency between the different elements like so: •
awsx.ecs.Cluster
takes a
capacityProviders
array on creation, but •
aws.ecs.CapacityProvider
needs the ARN of an
autoscalingGroup
, but • the
autoscalingGroup
is created via
cluster.createAutoScalingGroup(...)
which is not available until after the cluster is created. I hope that's enough context! I can provide more code if that would be useful. Basically where I want to get to is an ASG with
n
instances in, where every time a
pulumi up
happens the group scales up to
2n
instances to place new tasks, then scales back down to
n
instances, getting rid of the old ones. Right now
pulumi up
completes successfully but new tasks don't happen unless I specify the ASG should be permanently twice as big as it needs to be.