vpc.tf 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. resource "yandex_vpc_network" "vpc-infra" {
  2. name = "vpc-infra"
  3. }
  4. resource "yandex_vpc_route_table" "route-to-remote" {
  5. name = "route-to-remote"
  6. network_id = yandex_vpc_network.vpc-infra.id
  7. static_route {
  8. destination_prefix = "192.168.0.0/24"
  9. next_hop_address = "10.10.5.5"
  10. }
  11. }
  12. resource "yandex_vpc_subnet" "frontend-subnet-a" {
  13. name = "frontend-subnet-a"
  14. zone = "ru-central1-a"
  15. network_id = yandex_vpc_network.vpc-infra.id
  16. v4_cidr_blocks = ["10.240.1.0/24"]
  17. route_table_id = yandex_vpc_route_table.route-to-remote.id
  18. }
  19. resource "yandex_vpc_subnet" "frontend-subnet-b" {
  20. name = "frontend-subnet-b"
  21. zone = "ru-central1-b"
  22. network_id = yandex_vpc_network.vpc-infra.id
  23. v4_cidr_blocks = ["10.240.2.0/24"]
  24. route_table_id = yandex_vpc_route_table.route-to-remote.id
  25. }
  26. resource "yandex_vpc_subnet" "frontend-subnet-c" {
  27. name = "frontend-subnet-c"
  28. zone = "ru-central1-c"
  29. network_id = yandex_vpc_network.vpc-infra.id
  30. v4_cidr_blocks = ["10.240.3.0/24"]
  31. route_table_id = yandex_vpc_route_table.route-to-remote.id
  32. }
  33. resource "yandex_vpc_subnet" "vpn-subnet-a" {
  34. name = "vpn-subnet-a"
  35. zone = "ru-central1-a"
  36. network_id = yandex_vpc_network.vpc-infra.id
  37. v4_cidr_blocks = ["10.10.5.0/24"]
  38. route_table_id = yandex_vpc_route_table.route-to-remote.id
  39. }
  40. resource "yandex_vpc_subnet" "backend-subnet-a" {
  41. name = "backend-subnet-a"
  42. zone = "ru-central1-a"
  43. network_id = yandex_vpc_network.vpc-infra.id
  44. v4_cidr_blocks = ["10.110.1.0/24"]
  45. route_table_id = yandex_vpc_route_table.route-to-remote.id
  46. }
  47. resource "yandex_vpc_subnet" "backend-subnet-b" {
  48. name = "backend-subnet-b"
  49. zone = "ru-central1-b"
  50. network_id = yandex_vpc_network.vpc-infra.id
  51. v4_cidr_blocks = ["10.110.2.0/24"]
  52. route_table_id = yandex_vpc_route_table.route-to-remote.id
  53. }
  54. resource "yandex_vpc_subnet" "backend-subnet-c" {
  55. name = "backend-subnet-c"
  56. zone = "ru-central1-c"
  57. network_id = yandex_vpc_network.vpc-infra.id
  58. v4_cidr_blocks = ["10.110.3.0/24"]
  59. route_table_id = yandex_vpc_route_table.route-to-remote.id
  60. }