You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.1 KiB

  1. resource "null_resource" "dummy_dependency" {
  2. triggers = {
  3. dependency_id = var.router_id
  4. }
  5. }
  6. resource "openstack_networking_floatingip_v2" "k8s_master" {
  7. count = var.number_of_k8s_masters
  8. pool = var.floatingip_pool
  9. depends_on = [null_resource.dummy_dependency]
  10. }
  11. resource "openstack_networking_floatingip_v2" "k8s_master_no_etcd" {
  12. count = var.number_of_k8s_masters_no_etcd
  13. pool = var.floatingip_pool
  14. depends_on = [null_resource.dummy_dependency]
  15. }
  16. resource "openstack_networking_floatingip_v2" "k8s_node" {
  17. count = var.number_of_k8s_nodes
  18. pool = var.floatingip_pool
  19. depends_on = [null_resource.dummy_dependency]
  20. }
  21. resource "openstack_networking_floatingip_v2" "bastion" {
  22. count = var.number_of_bastions
  23. pool = var.floatingip_pool
  24. depends_on = [null_resource.dummy_dependency]
  25. }
  26. resource "openstack_networking_floatingip_v2" "k8s_nodes" {
  27. for_each = var.number_of_k8s_nodes == 0 ? { for key, value in var.k8s_nodes : key => value if value.floating_ip } : {}
  28. pool = var.floatingip_pool
  29. depends_on = [null_resource.dummy_dependency]
  30. }