pulumi / pulumi-awsx

AWS infrastructure best practices in component form!
https://www.pulumi.com/docs/guides/crosswalk/aws/
Apache License 2.0
218 stars 104 forks source link

No option to specify Availability Zones for Autoscaling groups #536

Open gsuess opened 4 years ago

gsuess commented 4 years ago

AWS Autoscaling Groups support the option to be constrained to specific AZs.

This is option is available on the underlying provider and should be exposed.

WIthout it, we cannot use the ec2 instance to interact with single AZ resources (i.e. EBS).

gsuess commented 4 years ago

A possible and very feasible workaround is to only attach a subnets of a single AZ.

Given an AWSX VPC vpc and ECS cluster cluster:

cluster.createAutoScalingGroup(
    name,
    {
      vpc,
      subnetIds: pulumi.output(vpc.subnets).apply(([{subnet}]) => [subnet.id]),
      ...
    }
);

This will automatically infer that the group should only live in the single AZ that corresponds to the single subnet.