Open mikemaccana opened 3 years ago
While this is a Python example, you may want to take a look at https://github.com/pulumi/examples/tree/master/aws-py-ecs-instances-autoapi which uses EC2 instances as the underlying capacity provider instead of Fargate.
Thanks for coming back @leezen ! I've actually solved this one myself I believe - the autoScaleGroup
configuration used in this article mentioned fails because it's missing health checks. The awsx
TypeScript SDK specifically: there should either be a default for this value (in keeping with awsx
role as high value Pulumi specific value adds) or these keys should be required - on that basis I'd mark this issue as a bug rather than a Feature Enhancement:
Here's the fix for the autoScaleGroup
section:
const autoScaleGroup = ecsCluster.createAutoScalingGroup(
config.ecs.autoScalingGroupName,
{
vpc,
templateParameters: {
minSize: 1,
maxSize: 5,
healthCheckGracePeriod: 300,
healthCheckType: "EC2",
},
launchConfigurationArgs: {
instanceType: config.ecs.instanceType as aws.ec2.InstanceType,
},
}
);
@mikemaccana Thanks for clarifying! Any chance you'd like to submit a PR with that fix?
Hrm I stand corrected - the issue didn't occur for a while, but is now back:
aws:cloudformation:Stack (hl-pulumi-autoscale-group):
error: 1 error occurred:
* creating urn:pulumi:hl-pulumi::humanloop::awsx:x:ecs:Cluster$awsx:x:autoscaling:AutoScalingGroup$aws:cloudformation/stack:Stack::hl-pulumi-autoscale-group: 1 error occurred:
* error waiting for CloudFormation Stack creation: failed to create CloudFormation stack, rollback requested (ROLLBACK_COMPLETE): ["The following resource(s) failed to create: [Instances]. Rollback requested by user." "Received 0 SUCCESS signal(s) out of 1. Unable to satisfy 100% MinSuccessfulInstancesPercent requirement"]
I don't think it's the health checks.
File: themes/default/content/docs/guides/crosswalk/aws/ecs.md
Hi there,
I'm looking at a solution to manage a machine learning ECS cluster, potentially looking at being a Pulumi customer if I can get Pulumi to work. As Fargate doesn't support GPU instances, we have to use ECS Classic.
I cannot get this example working for EC2 Classic - this guide is really difficult for ECS classic users. Nearly every item that's about 'ECS' seems to call Fargate - I know that:
And I've attempted to follow the guide with:
but it would be much easier if there was a working ECS Classic example in a GitHub repository.