adamant-mechanic-40684
12/06/2021, 8:55 PMimport * as awsx from "@pulumi/awsx";
const lb = new awsx.lb.NetworkListener("loadbalancer", { port: 80 });
// Need explicit cluster bc we have to define ec2 autoscaling group
const cluster = new awsx.ecs.Cluster("ec2-cluster");
cluster.createAutoScalingGroup("ec2-cluster-asg", {
templateParameters: { minSize: 2 },
launchConfigurationArgs: { instanceType: "t2.nano" },
});
// Will build our app image and push to ECR
const appImage = awsx.ecs.Image.fromPath("app-docker-image", "./app");
const appService = new awsx.ecs.EC2Service("app", {
cluster,
taskDefinitionArgs: {
containers: {
app: {
image: appImage,
portMappings: [lb],
memoryReservation: 256,
},
},
},
desiredCount: 2,
});
export const url = lb.endpoint;
When I go to pulumi up
I get an error creating the autoscale group cloudformation stack
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." "Property AvailabilityZones cannot be empty."]
I'm under the impression auto scaling would be using the clusters azs? Not seeing a good place to specify the az either, so I think I'm missing something?
Any help would be much appreciated!billowy-army-68599
12/06/2021, 9:19 PMadamant-mechanic-40684
12/06/2021, 9:47 PM