loft-sh / devpod-provider-aws

DevPod on AWS
Mozilla Public License 2.0
13 stars 8 forks source link

feat: Specify subnet id list and allow selection of availability zone #39

Closed roehrijn closed 2 days ago

roehrijn commented 1 month ago

This PR:

Jan Roehrich jan.roehrich@mercedes-benz.com, Mercedes-Benz Tech Innovation GmbH, legal info/Impressum

bkneis commented 1 month ago

Thanks for the contribution @roehrijn! This looks very useful. I left just a couple of minor remarks / questions. Could you also comment on the PR a brief description of how you tested these changes. Many thanks

roehrijn commented 1 month ago

Could you also comment on the PR a brief description of how you tested these changes. Many thanks

of course, going to add that soon. What I can say so far: I prepared resources in AWS accounts for every situation which could happen while traversing GetSubnet(). In other words, I think I covered every branch in that function during my tests.

roehrijn commented 1 month ago

How I tested:

  1. specify a single subnet id through AWS_SUBNET_ID -> Subnet is choosen :heavy_check_mark:
  2. specify three subnet ids through AWS_SUBNET_ID -> least occupied subnet is choosen :heavy_check_mark:
  3. specify six subnet ids, 2 per AZ, through AWS_SUBNET_ID + set availibility zone through AWS_AVAILABILITY_ZONE -> least occupied subnet in desired availability zone is choosen :heavy_check_mark:
  4. having two VPCs, each with 3 subnets in one account. Subnets of one VPC are tagged with devpod:devpod. No AWS_... environment variables except credentials -> least occupied tagged subnet is choosen :heavy_check_mark:
  5. having two VPCs, each with 3 subnets in one account. Subnets of one VPC are tagged with devpod:devpod. Availability zone set through AWS_AVAILABILITY_ZONE -> subnet in desired AZ is choosen :heavy_check_mark:
  6. having two VPCs, each with 3 subnets in one account. Subnets of one VPC are tagged with devpod:devpod. VPC ID set through AWS_VPC_ID -> tagged subnet in desired VPC is choosen :heavy_check_mark:
  7. having two VPCs, one with tagged subnets, one default VPC with public IP assignment enabled subnets. VPC ID of default VPC is given through AWS_VPC_ID -> least occupied subnet in default VPC with public IP assignment enabled is choosen :heavy_check_mark: