https://pulumi.com logo
#general
Title
# general
f

full-dress-10026

06/21/2019, 3:50 PM
Does
pulumi.awsx.autoscaling.AutoScalingGroup
only support ECS? If so, why? Seems like it could support instances that don't use the ECS AMI. https://github.com/pulumi/pulumi-awsx/blob/a8dd50c8f5be5137686553cfb4a4d62041481f1b/nodejs/awsx/autoscaling/launchConfiguration.ts#L279-L414
p

proud-alarm-92546

06/21/2019, 3:59 PM
if i recall from having used it the other day, it supported everything that
aws application-autoscaling
supports. (which may not be the autoscaling you're looking for)
but I only used it for fargate, so my actual depth was limited.
f

full-dress-10026

06/21/2019, 4:00 PM
Not sure what aws-application-autoscaling supports. I cannot see a property on
AutoScalingGroup
that would allow me to pass in an arbitrary ami id. It only has
ecsOptimizedAMIName
.
p

proud-alarm-92546

06/21/2019, 4:01 PM
Copy code
*      Application Auto Scaling can scale the following resources:

       o Amazon ECS services. For more information, see Service  Auto  Scaling
         in the Amazon Elastic Container Service Developer Guide .

       o Amazon  EC2  Spot fleets. For more information, see Automatic Scaling
         for Spot Fleet in the Amazon EC2 User Guide .

       o Amazon EMR clusters. For more information, see Using Automatic  Scal-
         ing in Amazon EMR in the Amazon EMR Management Guide .
         for Spot Fleet in the Amazon EC2 User Guide .

       o Amazon EMR clusters. For more information, see Using Automatic  Scal-
         ing in Amazon EMR in the Amazon EMR Management Guide .

       o AppStream  2.0  fleets.  For more information, see Fleet Auto Scaling
         for Amazon AppStream 2.0 in the Amazon AppStream 2.0 Developer  Guide
         .

       o Provisioned  read  and  write capacity for Amazon DynamoDB tables and
         global secondary indexes. For more information, see Managing Through-
         put  Capacity  Automatically with DynamoDB Auto Scaling in the Amazon
         DynamoDB Developer Guide .

       o Amazon Aurora Replicas. For more information, see Using Amazon Aurora
         Auto Scaling with Aurora Replicas .

       o Amazon   SageMaker  endpoint  variants.  For  more  information,  see
         Automatically Scaling Amazon SageMaker Models .

       o Custom resources provided by your own applications or services.  More
         information is available in our GitHub repository .
(from
% aws application-autoscaling help
)
f

full-dress-10026

06/21/2019, 4:02 PM
Yeah that doesn't say anything about plain old ec2 instances.
p

proud-alarm-92546

06/21/2019, 4:04 PM
ec2 autoscaling looks like definitely a different thing
f

full-dress-10026

06/21/2019, 4:05 PM
Ya. Gotta love the aws naming scheme šŸ™‚
p

proud-alarm-92546

06/21/2019, 4:05 PM
indeed
pulumi-aws/autoscaling
is probably the one your looking for, doesnt look like awsx provides any wrappers over it
(
awsx/autoscaling
wraps
aws/appautoscaling
)
f

full-dress-10026

06/21/2019, 4:08 PM
Right. Fairly similar, just doesn't have the ability to pass actual objects in (i.e. `Role`s)
w

white-balloon-205

06/21/2019, 6:37 PM
This is a limitation of the current design - but it should definitely be expanded to support more general ASG usage. Opened https://github.com/pulumi/pulumi-awsx/issues/340. Note that there are two AWS features here which are actually pretty different: ā€¢
autoscaling
- which is EC2 autoscaling groups ā€¢
appautoscaling
- which defines generic autoscaling for a variety of others AWS services - including ECS Services The latter has no abstractions in
awsx
yet - but can be used on top of existing
awsx
abstractions easily to autoscale an ECS service for example.
pulumi.awsx.autoscaling.AutoScalingGroup
is intended to support creating autoscaling groups of EC2 instances, either as backing clusters for something like ECS or EKS, or as pools of raw EC2 servers for delivering applications directly. cc @lemon-spoon-91807
l

lemon-spoon-91807

06/21/2019, 6:38 PM
Thanks
@full-dress-10026 Any interest in contributing changes here?
Note: as a very simple change, i could make it work right now such that
awsx.autoscaling.AutoScalingGroup
can be provided the launch-config-id for any launch config you want to make.
that's all we really need to pass along. that would at least make it possible for you to create whateer you want and let us know about it to make the asg.
@full-dress-10026 would be curious for you to try out https://github.com/pulumi/pulumi-awsx/pull/342
and to see if it was sufficient for your needs
and, if not, what else would need to be exposed.
we can then roll that info into future improvements here (and in app-autoscaling once we get around to that)
i've never tried using these other sorts of auto scaling areas, so i would def benefit from feedback from someone directly in that space.
i can publish this to a feature branch
f

full-dress-10026

06/21/2019, 9:11 PM
This is a low priority experiment so I don't think I'll have the time to implement this myself. I got it working using the pulumi-aws package. It was just confusing that the awsx auto scaling group couldn't do something like this but was similar enough that it seemed like it should work. I gave up trying to get an autoscaling group to work with a launch template because you always get this obtuse error:
Copy code
Plan apply failed: Error creating AutoScaling Group: ValidationError: You must use a valid fully-formed launch template. The requested configuration is currently not supported. Please check the documentation for supported configurations.
Using a launch configuration seemed to work. Passing the launch template to the awsx asg would let us at least use the awsx asg component. Though, not sure how that would be much different than just using pulumi-aws asg component.
l

lemon-spoon-91807

06/21/2019, 9:58 PM
If you can link to your code, that will be great
Luke and I talked. We can easily fix up ASG to be non ecs opinionated. It will still be ec2 opinionated. Future work can cover app-asg
@white-balloon-205 I was wrong about the userData section. We just do the cfn-signal stuff. but that looks ec2 specific, not ecs. so it's likely fine to keep in.
Ok, have a potential real fix here: https://github.com/pulumi/pulumi-awsx/pull/343
going to be in a feature branch. I'll ping you @full-dress-10026 about trying it out if you're willing.
basically, this will be published to npm under a special version
You can then just refer to that version and try things out! šŸ™‚
but, for now, weekend time.
f

full-dress-10026

06/21/2019, 11:49 PM
Sure, happy to try it out.