Skip to content

Commit

Permalink
refactor: deploy subnets for every az in aws (#330)
Browse files Browse the repository at this point in the history
subnets are regional in azure and gcp, so we're mimicking that behavior in aws
this means:
- subnets in aws generate 1 subnet for each availability zone
- for regional and highly available resources (kubernetes node pool and databases for now) we use all generated AWS subnets
- for zonal resources (vms, network interfaces), a zone is selected and the appropriate subnet with it
- for resources that are associated with single subnets (route table associations) we create 1 for each subnet
  • Loading branch information
goncalo-rodrigues authored Jul 4, 2022
1 parent 708a01d commit 617e5c4
Show file tree
Hide file tree
Showing 59 changed files with 1,514 additions and 1,346 deletions.
106 changes: 63 additions & 43 deletions api/proto/resourcespb/database.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions api/proto/resourcespb/database.proto
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ message DatabaseArgs {
string password = 8;
repeated string subnet_ids = 9;
int32 port = 10;
string subnet_id = 11;
}

message DatabaseResource {
Expand All @@ -57,6 +58,7 @@ message DatabaseResource {
string password = 8;
repeated string subnet_ids = 9;
int32 port = 12;
string subnet_id = 13;

//outputs
string host = 10;
Expand Down
64 changes: 43 additions & 21 deletions api/proto/resourcespb/network_interface.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions api/proto/resourcespb/network_interface.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ message NetworkInterfaceArgs {
string name = 2;
string subnet_id = 3;
string public_ip_id = 4;
int32 availability_zone = 5;
}

message NetworkInterfaceResource {
common.CommonResourceParameters common_parameters = 1;
string name = 2;
string subnet_id = 3;
string public_ip_id = 4;
int32 availability_zone = 5;
}
Loading

0 comments on commit 617e5c4

Please sign in to comment.