Following this guide: <https://www.pulumi.com/docs...
# general
q
Following this guide: https://www.pulumi.com/docs/guides/crosswalk/aws/ecs/#creating-an-auto-scaling-group-for-ecs-cluster-instances I am calling
createAutoScalingGroup
on an
awsx.ecs.Cluster
. I get the error
Property AvailabilityZones cannot be empty
. I don’t see an option for setting
availabilityZones
through
createAutoScalingGroup
.
l
Hi @quick-action-34599 I can take a look when I get into the office. I believe we infer a lot of that stuff from your default vpc.
q
okey doke. I’m trying to manually set the vpc and subnetIds. We’ll see if that helps
l
If you don't have a default vpc, we might end up seeing strangeness.
Could you try manually setting up the vpc and passing to the cluster?
Ok thanks!
q
Yea the cluster already has the vpc set
Manually specifying the vpc and subnetIds on the ASG did not help. Same error about the availabilityZones
l
Interesting. Cold you point me at the code that sets up the vpc?
Also, will be in the office after 10. Can continue with you then! :-)
q
np no rush at all!
Oh it’s default vpc btw:
awsx.ec2.Vpc.getDefault();
l
So one issue, that we don't handle well that, is that some old aws accounts don't have a default vpc
I.e. the above will give you back a Vpc instance that is basically not useful
If you look at that value for the vpc does it have reasonable values for the subnets and whatnot
q
Oh hey Luke opened an issue on this back in May: https://github.com/pulumi/pulumi-awsx/issues/289 going to try using
vpc.publicSubnetIds
a
@quick-action-34599 We have an old aws account and this is the code we use to get an ECS cluster, might help.
Copy code
const vpcId = stackRef.requireOutputSync("vpcId");
const vpcPrivateSubnetIds = <string[]>stackRef.requireOutputSync("vpcPrivateSubnetIds");
const vpcPublicSubnetIds = <string[]>stackRef.requireOutputSync("vpcPublicSubnetIds");
const vpc = awsx.ec2.Vpc.fromExistingIds("vpc", {
  privateSubnetIds: vpcPrivateSubnetIds,
  publicSubnetIds: vpcPublicSubnetIds,
  vpcId
});
const cluster = new awsx.ecs.Cluster("cluster", {
  cluster: stackRef.requireOutputSync("clusterId") as string,
  vpc
});
nevermind, linked issue looks to be your culprit
q
hooray that worked!
l
Yeah, just saw that issue. Had forgotten about it. LOoks like something we def need to improve.