https://pulumi.com logo
Title
n

narrow-house-7133

02/03/2023, 12:31 PM
hi there! Is there an example project that shows how to set up AWS Autoscaling for ECS Service on pulumi? Preferably with Typescript, but any other language also works.
m

magnificent-scientist-64889

02/03/2023, 12:37 PM
There is documentation using the
@pulumi/awsx
module, also know as Pulumi Crosswalk for AWS. See: https://www.pulumi.com/docs/guides/crosswalk/aws/autoscaling/
n

narrow-house-7133

02/03/2023, 12:41 PM
thanks for the links Steffen! From what I see, the first link shows how to autoscale a cluster when it's used with EC2 instances. I'm curious on autoscaling an ECS Service (min/max size based on autoscaling policies, for example: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-configure-auto-scaling.html) that runs on Fargate.
m

magnificent-scientist-64889

02/03/2023, 12:43 PM
The first shows scaling ec2 either running instances or running ECS cluster. The second link is on the Elastic Container Service. awsx is pulumi components, that wrap aws for setting up best practice infrastructure. If you need to handle it yourself, you might find inspiration in the pulumi-awsx repository.
n

narrow-house-7133

02/03/2023, 12:51 PM
sorry Steffen, but I still don't see any hint on what I'm looking for. For example, see the following screenshot from AWS UI. It's possible to set up autoscaling policy per ECS Service. Is that possible to achieve with pulumi?
note that, no EC2 autoscaling is involved here.
m

magnificent-scientist-64889

02/03/2023, 12:59 PM
https://github.com/pulumi/pulumi-awsx/issues/689#issuecomment-1202563087 This comment suggests using
new aws.appautoscaling.Target
n

narrow-house-7133

02/03/2023, 1:39 PM
nice! Thanks a lot 🙏