example.tftest.hcl 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # GENERATED from terraform.tfvars.example by scripts/gen_example_tests.py. Do not
  2. # edit by hand: change the example file and run
  3. # `python -I scripts/gen_example_tests.py`. CI fails when this file is stale.
  4. # It plans the stack with the example values, so the example stays valid.
  5. mock_provider "twingate" {}
  6. variables {
  7. # Example values for stacks/20-telemetry. Copy this file to terraform.tfvars
  8. # (which git ignores) for a local plan. Never put a token or key in a value file:
  9. # those live in Doppler. Every value here is a placeholder. The feature flags
  10. # are false here on purpose: this stack creates nothing until both a flag is
  11. # true and the Twingate plan has been checked (docs/stages/02-telemetry.md).
  12. # DigitalOcean region slug of the site, from the foundation stack's region output.
  13. region = "tor1"
  14. # Used in the NAMES of the Twingate objects. Empty means region. IMMUTABLE for the
  15. # life of a stack: changing it renames, and so replaces, every object. Use the
  16. # same value as the site's foundation and access stacks.
  17. resource_key = ""
  18. # A label for telemetry only (empty means "site-<region>"). It appears in no
  19. # resource name or tag, and changing it replaces nothing.
  20. site_name = "site-tor1"
  21. # Create the logging service and one Twingate resource per logging_servers element.
  22. logging_enabled = false
  23. # Create the scrape service and one Twingate resource per scrape_allowlist entry
  24. # per connector.
  25. metrics_enabled = false
  26. # The home logging endpoints, reached only through Twingate. Private: the real
  27. # list comes from the site's Doppler config, not this file. The validation accepts
  28. # a documentation range on purpose so this example is valid; 192.0.2.0/24 is one.
  29. logging_servers = [
  30. { name = "siem-home-agent", address = "192.0.2.10", port = 1514, protocol = "tcp", purpose = "wazuh-agent" },
  31. { name = "siem-home-enroll", address = "192.0.2.10", port = 1515, protocol = "tcp", purpose = "wazuh-enroll" },
  32. ]
  33. # Id of the Twingate remote network that holds the home logging connector. Private:
  34. # the real one comes from your secret store. Required when logging_enabled.
  35. home_remote_network_id = "example-home-remote-network-id"
  36. # Id of this site's cloud remote network (access-<resource_key>, made by stack 10).
  37. # Required when metrics_enabled.
  38. cloud_remote_network_id = "example-cloud-remote-network-id"
  39. # TCP port of the node exporter on each connector. Keep it equal to
  40. # node_exporter.port in the access stack (stack 10), which installs the exporter.
  41. node_exporter_port = 9100
  42. # TCP port of the connector's own metrics endpoint. Keep it equal to
  43. # connector_telemetry.metrics_port in the access stack, and never 9100. Illustrative
  44. # only: the connector's metrics bind address is unverified and the port has no
  45. # default. Test it on one connector first.
  46. metrics_port_connector = 9101
  47. # Which connector endpoints become Twingate resources for scraping. Each port must
  48. # be one of the two ports above.
  49. scrape_allowlist = [
  50. { name = "node", host_role = "connector", port = 9100 },
  51. ]
  52. # The access stack's connector_private_ips output (keys a and b). Private, so
  53. # empty here; it arrives from the stack dependency or by hand.
  54. connector_private_ips = {}
  55. # Wazuh agent group for this site's cloud hosts (telemetry label only).
  56. wazuh_agent_group = "cloud-site-tor1"
  57. # Extra telemetry labels. Only env, role and owner_team are allowed.
  58. labels = { env = "example" }
  59. # Additional sites served by this stack, keyed by each site's resource_key
  60. # (IMMUTABLE once applied). Empty means one site and no change to the plan. Each
  61. # entry gets its own logging and scrape Twingate service, never shared. Shape:
  62. # { tor2 = { site_name = "site-tor2", cloud_remote_network_id = "...",
  63. # connector_private_ips = { a = "...", b = "..." } } }. Private: the real
  64. # values come from the site's Doppler config.
  65. sites = {}
  66. }
  67. run "the_example_values_are_valid" {
  68. command = plan
  69. }