### View Example Directory Structure Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/README.md Displays the organization of resource and data-source examples within the repository. ```bash examples/ ├── resources/ │ ├── remnawave_user/ # User with traffic limit + tag │ ├── remnawave_node_action/ # Periodic traffic reset via triggers │ ├── remnawave_host_bulk_action/# Bulk enable/disable/delete │ ├── remnawave_user_bulk_action/# Bulk user operations │ ├── remnawave_node_bulk_action/# Bulk node operations │ ├── remnawave_user_action/ # Enable/disable/reset/revoke/extend │ └── remnawave_passkey/ # Import + manage existing passkeys └── data-sources/ ├── remnawave_users/ # List all users ├── remnawave_system_stats/ # Dashboard metrics └── remnawave_passkeys/ # List passkeys ``` -------------------------------- ### Quick Start Configuration Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/README.md Basic provider setup and resource definition for managing a Remnawave user. ```hcl terraform { required_providers { remnawave = { source = "batonogov/remnawave" version = "~> 1.0" # x-release-please-major } } } provider "remnawave" { # REMNAWAVE_ENDPOINT and REMNAWAVE_API_TOKEN are read from the environment. } resource "remnawave_user" "quickstart" { username = "terraform-quickstart" expire_at = "2030-01-01T00:00:00.000Z" traffic_limit_bytes = 10737418240 # 10 GiB traffic_limit_strategy = "MONTH" description = "Managed by Terraform" } ``` -------------------------------- ### Example Usage of remnawave_system_bandwidth_stats Data Source Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/data-sources/system_bandwidth_stats.md This example shows how to use the `remnawave_system_bandwidth_stats` data source to fetch system bandwidth statistics and output them. ```terraform data "remnawave_system_bandwidth_stats" "current" {} output "system_bandwidth" { value = data.remnawave_system_bandwidth_stats.current } ``` -------------------------------- ### remnawave_passkey Resource Example Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/passkey.md Example of how to import an existing passkey using the remnawave_passkey resource. No configuration is needed as all attributes are computed after import. ```terraform # Import an existing passkey so it can be managed by Terraform. # All attributes are computed after import — no configuration is needed. resource "remnawave_passkey" "laptop" { } ``` -------------------------------- ### Example Usage of remnawave_hosts Data Source Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/data-sources/hosts.md This example shows how to use the remnawave_hosts data source to retrieve a list of all hosts and then output their details. ```terraform data "remnawave_hosts" "all" {} output "all_hosts" { value = data.remnawave_hosts.all.hosts } ``` -------------------------------- ### Environment Setup and Execution Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/README.md Commands to set environment variables and execute Terraform lifecycle operations. ```sh export REMNAWAVE_ENDPOINT="https://panel.example.com" export REMNAWAVE_API_TOKEN="..." terraform init terraform plan terraform apply ``` -------------------------------- ### Example Usage of Subscription Request History Stats Data Source Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/data-sources/subscription_request_history_stats.md This example shows how to use the remnawave_subscription_request_history_stats data source to fetch subscription request history statistics and output them. ```terraform data "remnawave_subscription_request_history_stats" "stats" {} output "sub_history_stats" { value = data.remnawave_subscription_request_history_stats.stats } ``` -------------------------------- ### remnawave_node_action Restart Example Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/node_action.md Example of how to restart a Remnawave node using the remnawave_node_action resource. The `force_restart` argument is set to true, and triggers are provided to ensure re-execution. ```terraform resource "remnawave_node_action" "restart" { node_uuid = "550e8400-e29b-41d4-a716-446655440000" action = "restart" force_restart = true triggers = ["maintenance-window-2026-01"] } ``` -------------------------------- ### Example Usage of remnawave_bandwidth_stats Data Source Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/data-sources/bandwidth_stats.md This snippet shows how to use the remnawave_bandwidth_stats data source to fetch monthly bandwidth statistics. It specifies the start and end dates for the data retrieval and outputs the retrieved bandwidth data. ```terraform data "remnawave_bandwidth_stats" "monthly" { start = "2026-01-01" end = "2026-01-31" } output "monthly_bandwidth" { value = data.remnawave_bandwidth_stats.monthly } ``` -------------------------------- ### remnawave_node_bulk_action Restart Example Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/node_bulk_action.md This example demonstrates how to restart selected nodes during a maintenance window using the remnawave_node_bulk_action resource. The action is set to 'restart' and specific node UUIDs are provided. A 'triggers' map is included to force re-execution when the maintenance window value changes. ```terraform resource "remnawave_node_bulk_action" "restart" { action = "restart" uuids = [ "550e8400-e29b-41d4-a716-446655440000", "550e8400-e29b-41d4-a716-446655440001", ] triggers = { maintenance_window = "2026-01" } } ``` -------------------------------- ### Example Usage of remnawave_host_tags Data Source Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/data-sources/host_tags.md This snippet demonstrates how to use the `remnawave_host_tags` data source to fetch all unique host tags and then output them. Ensure the data source is correctly configured in your Terraform setup. ```terraform data "remnawave_host_tags" "all" {} output "all_host_tags" { value = data.remnawave_host_tags.all.tags } ``` -------------------------------- ### Example Usage of remnawave_passkeys Data Source Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/data-sources/passkeys.md Demonstrates how to use the remnawave_passkeys data source to retrieve passkey information and output the count of registered passkeys. ```terraform data "remnawave_passkeys" "current" {} output "passkey_count" { value = length(data.remnawave_passkeys.current.passkeys) } ``` -------------------------------- ### Basic Usage of remnawave_hwid_top_users Data Source Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/data-sources/hwid_top_users.md This example shows how to declare the data source and output its raw JSON response. The `response` attribute will contain the raw JSON string from the API. ```terraform data "remnawave_hwid_top_users" "top10" {} output "hwid_top_users" { value = data.remnawave_hwid_top_users.top10 } ``` -------------------------------- ### Example Usage of remnawave_bandwidth_realtime Data Source Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/data-sources/bandwidth_realtime.md This snippet shows how to declare the data source and output its retrieved data. Ensure the Remnawave provider is configured before use. ```terraform data "remnawave_bandwidth_realtime" "current" {} output "realtime_bandwidth" { value = data.remnawave_bandwidth_realtime.current } ``` -------------------------------- ### Example Usage of remnawave_config_profiles Data Source Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/data-sources/config_profiles.md This snippet demonstrates how to fetch all Remnawave configuration profiles using the data source and then output their names. ```terraform data "remnawave_config_profiles" "all" {} output "profiles" { value = data.remnawave_config_profiles.all.config_profiles } ``` -------------------------------- ### Example Usage of remnawave_hwid_stats Data Source Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/data-sources/hwid_stats.md This snippet shows how to use the `remnawave_hwid_stats` data source to fetch HWID statistics and output them. ```terraform data "remnawave_hwid_stats" "current" {} output "hwid_stats" { value = data.remnawave_hwid_stats.current } ``` -------------------------------- ### remnawave_node_action Reset Traffic Example Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/node_action.md Example of how to reset traffic on a Remnawave node using the remnawave_node_action resource. Triggers are included to manage re-execution based on changes. ```terraform resource "remnawave_node_action" "reset_traffic" { node_uuid = "550e8400-e29b-41d4-a716-446655440000" action = "reset_traffic" triggers = ["billing-period-2026-01"] } ``` -------------------------------- ### Example Usage of remnawave_keygen Data Source Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/data-sources/keygen.md Demonstrates how to use the remnawave_keygen data source to fetch a panel's public key and output it as a sensitive value. This is typically used during the initial node configuration. ```terraform data "remnawave_keygen" "pubkey" {} output "panel_public_key" { value = data.remnawave_keygen.pubkey.pub_key sensitive = true } ``` -------------------------------- ### Example Usage of remnawave_system_nodes_stats Data Source Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/data-sources/system_nodes_stats.md This snippet shows how to use the remnawave_system_nodes_stats data source to fetch current node statistics and output them. ```terraform data "remnawave_system_nodes_stats" "current" {} output "node_stats" { value = data.remnawave_system_nodes_stats.current } ``` -------------------------------- ### Example Usage of remnawave_nodes_metrics Data Source Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/data-sources/nodes_metrics.md This snippet shows how to declare the remnawave_nodes_metrics data source to fetch live node metrics and then output these metrics. ```terraform data "remnawave_nodes_metrics" "live" {} output "node_metrics" { value = data.remnawave_nodes_metrics.live } ``` -------------------------------- ### Example Usage of remnawave_system_health Data Source Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/data-sources/system_health.md This snippet shows how to declare the data source and output its raw JSON response. ```terraform data "remnawave_system_health" "current" {} output "health" { value = data.remnawave_system_health.current } ``` -------------------------------- ### System Configuration Response Schema Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/dev/remnawave-3.1-vs-3.2-api-diff.md The structure of the response returned by the new GET /api/system/configuration endpoint. ```yaml notifications: webhook: boolean # WEBHOOK_ENABLED bandwidthUsage: number[] | null # BANDWIDTH_USAGE_NOTIFICATIONS_THRESHOLD notConnectedAfter: number[] | null # NOT_CONNECTED_USERS_NOTIFICATIONS_AFTER_HOURS expirationNotifications: number[] | null # EXPIRATION_NOTIFICATIONS service: cleanUsageHistory: boolean # SERVICE_CLEAN_USAGE_HISTORY disableUserUsageRecords: boolean # SERVICE_DISABLE_USER_USAGE_RECORDS disableSrhRecords: boolean # SERVICE_DISABLE_SRH_RECORDS exportToRedisStream: boolean # EXPORT_TO_STREAM_ENABLED misc: shortUuidLength: number # SHORT_UUID_LENGTH userUsageIgnoreBelowBytes: number # USER_USAGE_IGNORE_BELOW_BYTES subPublicDomain: string # SUB_PUBLIC_DOMAIN ``` -------------------------------- ### remnawave_keygen Data Source Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/data-sources/keygen.md The `remnawave_keygen` data source is used to retrieve the panel's public key for node setup. The retrieved public key can be accessed via the `pub_key` attribute and is marked as sensitive. ```APIDOC ## remnawave_keygen (Data Source) ### Description Returns the panel's public key for node setup. ### Usage ```terraform data "remnawave_keygen" "pubkey" {} output "panel_public_key" { value = data.remnawave_keygen.pubkey.pub_key sensitive = true } ``` ### Schema #### Read-Only Attributes - **pub_key** (String, Sensitive) - Panel public key. ``` -------------------------------- ### Build and Test Commands Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/README.md Standard commands for building the binary, formatting, linting, and running tests. ```bash # Build the provider binary go build -o terraform-provider-remnawave # Format code gofmt -w provider/*.go # Lint golangci-lint run # Unit tests (no Docker needed) go test ./provider/... -race -cover # Reachable vulnerability scan task test:vuln # Acceptance tests (starts Remnawave panel via Docker Compose) task test:acc ``` -------------------------------- ### Development and Testing Commands Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/CONTRIBUTING.md Commands for building the provider, running tests, and managing documentation using Task. ```bash # Install Go 1.26.6+, Terraform 1.12+, Task, and Docker # Clone git clone https://github.com/batonogov/terraform-provider-remnawave.git cd terraform-provider-remnawave # Build go build -o terraform-provider-remnawave # Run unit tests task test:unit # Run race detection and create a coverage report task test:coverage # Regenerate or verify Terraform Registry documentation task docs task docs:check # Run acceptance tests; the task manages the complete Docker lifecycle task test:acc # Test a different explicitly pinned backend build REMNAWAVE_VERSION=3.3.2 REMNAWAVE_DIGEST=sha256: task test:acc # (defaults: REMNAWAVE_VERSION=3.4.3 with the digest from compat-versions.json) ``` -------------------------------- ### Select a release tag Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/release-verification.md Sets the environment variables required to identify the release version for verification. ```sh : "${TAG:?Set TAG to the release tag you want to verify}" repo=batonogov/terraform-provider-remnawave provider=batonogov/remnawave tag=$TAG version=${tag#v} ``` -------------------------------- ### Node Plugin Pre-start Configuration Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/dev/remnawave-3.0-vs-3.1-api-diff.md Schema for the optional preStart section in NodePluginSchema, used for tasks like Unix socket cleanup. ```json { "preStart": { "enabled": true, "cleanupSockets": { "enabled": true, "files": ["/dev/shm/*.sock"] } } } ``` -------------------------------- ### Bootstrap and verify the release key Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/release-verification.md Fetches the signing key from the Terraform Registry, validates its fingerprint, and imports it into the local GPG keyring. ```sh expected_fingerprint=CB77A6037F6CA36D514C8DC5B6D212FC24D5A5B1 expected_key_id=B6D212FC24D5A5B1 metadata=$(mktemp) release_key=$(mktemp) trap 'rm -f "$metadata" "$release_key"' EXIT curl -fsSL \ "https://registry.terraform.io/v1/providers/$provider/$version/download/linux/amd64" \ >"$metadata" jq -er --arg key_id "$expected_key_id" ' [.signing_keys.gpg_public_keys[] | select((.key_id | ascii_upcase) == $key_id) | .ascii_armor] | if length == 1 then .[0] else error("expected exactly one release key") end ' "$metadata" >"$release_key" actual_fingerprint=$( gpg --batch --show-keys --with-colons "$release_key" | awk -F: '$1 == "fpr" {print toupper($10); exit}' ) test "$actual_fingerprint" = "$expected_fingerprint" gpg --batch --import "$release_key" ``` -------------------------------- ### Initialize and Apply Terraform Configuration Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/examples/getting-started/README.md Sets the required environment variables for the provider and executes the standard Terraform lifecycle commands. ```sh export REMNAWAVE_ENDPOINT="https://panel.example.com" export REMNAWAVE_API_TOKEN="..." terraform init terraform plan terraform apply ``` -------------------------------- ### Run Acceptance Tests Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/README.md Execute acceptance tests against a Docker-based environment, with optional version overrides. ```bash # Run the complete Docker lifecycle + test suite task test:acc # Override the Remnawave version under test REMNAWAVE_VERSION=3.4.3 REMNAWAVE_DIGEST=sha256: task test:acc ``` -------------------------------- ### Drop connections by user UUIDs Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/drop_connections.md Example of using the resource to drop connections for specific users, utilizing a timestamp trigger to force re-execution. ```terraform resource "remnawave_drop_connections" "stale" { drop_by = "user_uuids" user_uuids = [remnawave_user.example.uuid] triggers = { timestamp = timestamp() } } ``` -------------------------------- ### Download release assets Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/release-verification.md Creates a directory and downloads release assets for a specific tag and repository. ```sh mkdir "remnawave-$tag" cd "remnawave-$tag" gh release download "$tag" --repo "$repo" ``` -------------------------------- ### Import Panel Settings Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/panel_settings.md Imports existing panel settings into the Terraform state using the required singleton ID. ```shell # Panel settings are a singleton; use the stable ID "settings". terraform import remnawave_panel_settings.main settings ``` -------------------------------- ### Retrieve user bandwidth statistics Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/data-sources/bandwidth_stats_user.md Fetches bandwidth data for a user identified by UUID within a specified start and end date range. ```terraform data "remnawave_bandwidth_stats_user" "user_monthly" { uuid = "550e8400-e29b-41d4-a716-446655440000" start = "2026-01-01" end = "2026-01-31" } ``` -------------------------------- ### Import subscription settings Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/subscription_settings.md Uses the terraform import command to bring existing subscription settings into state using the singleton ID. ```shell # Subscription settings are a singleton; use the stable ID "settings". terraform import remnawave_subscription_settings.main settings ``` -------------------------------- ### Verify SBOM provenance Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/release-verification.md Uses the GitHub CLI to verify the SBOM attestation against the release bundle and repository provenance. ```sh gh attestation verify "$sbom" \ --bundle "$bundle" \ --repo "$repo" \ --signer-workflow "$repo/.github/workflows/release-please.yml" \ --source-digest "$tag_sha" ``` -------------------------------- ### Import remnawave_user_action Resources Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/user_action.md Syntax for importing existing user actions into Terraform state based on the Remnawave version. ```shell # Remnawave 3.0+ uses :. terraform import remnawave_user_action.extend "42:extend_expiration" # Remnawave 2.x uses :. terraform import remnawave_user_action.reset "00000000-0000-0000-0000-000000000000:reset_traffic" ``` -------------------------------- ### Import a subscription template Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/subscription_template.md Uses the terraform import command to bring an existing subscription template into state using its UUID. ```shell # Import a subscription template by UUID. terraform import remnawave_subscription_template.xray 00000000-0000-0000-0000-000000000000 ``` -------------------------------- ### Apply Repository Security Policies Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/repository-security.md Commands to apply security configurations for either strict multi-reviewer or solo-maintainer modes. ```sh RELEASE_REVIEWER_ID=123456 \ ./scripts/configure-repository-security.sh --apply ``` ```sh ./scripts/configure-repository-security.sh --apply-solo ``` -------------------------------- ### Importing a remnawave_passkey Resource Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/passkey.md Demonstrates how to import an existing passkey into Terraform management using its UUID. ```shell # Import an existing passkey by its UUID. terraform import remnawave_passkey.laptop 00000000-0000-0000-0000-000000000000 ``` -------------------------------- ### Import an infrastructure provider Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/infra_provider.md Uses the terraform import command to bring an existing infrastructure provider into state using its UUID. ```shell # Import an infrastructure provider by UUID. terraform import remnawave_infra_provider.example 00000000-0000-0000-0000-000000000000 ``` -------------------------------- ### Regenerate Documentation Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/README.md Commands to generate and validate provider documentation using tfplugindocs. ```bash task docs # Format examples + regenerate Registry docs task docs:check # Validate and detect stale generated docs (CI gate) ``` -------------------------------- ### Import a remnawave_hwid_device resource Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/hwid_device.md Commands to import existing HWID device entries using different ID formats based on the Remnawave version. ```shell # Remnawave 3.0+ uses :. terraform import remnawave_hwid_device.phone 42:device-fingerprint-abc123 # Remnawave 2.x uses :. terraform import remnawave_hwid_device.phone 00000000-0000-0000-0000-000000000000:device-fingerprint-abc123 ``` -------------------------------- ### Inspect SBOM validity and contents Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/release-verification.md Uses jq to validate SPDX 2.3 compliance and extract package metadata from the generated SBOM file. ```sh sbom="${archive}.spdx.json" jq -e ' .spdxVersion == "SPDX-2.3" and (.packages | type == "array" and length > 0) and (.relationships | type == "array" and length > 0) ' "$sbom" jq -r ' .packages[] | [.name, .versionInfo, .licenseDeclared, .licenseConcluded] | @tsv ' "$sbom" ``` -------------------------------- ### Basic remnawave_system_recap Data Source Usage Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/data-sources/system_recap.md Use this data source to fetch a recap of system totals. The output can be assigned to a variable or directly used in other resources. ```terraform data "remnawave_system_recap" "current" {} output "recap" { value = data.remnawave_system_recap.current } ``` -------------------------------- ### Import a remnawave_snippet resource Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/snippet.md Use the terraform import command to bring an existing snippet into state by its name. ```shell # Import a snippet by name. terraform import remnawave_snippet.routing_rules my-snippet ``` -------------------------------- ### Import a subscription page config Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/subpage_config.md Uses the terraform import command to bring an existing subscription page config into state using its UUID. ```shell # Import a subscription page config by UUID. terraform import remnawave_subpage_config.custom 00000000-0000-0000-0000-000000000000 ``` -------------------------------- ### POST /api/snippets/actions/sync Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/dev/remnawave-3.2.2-vs-3.2.3-api-diff.md Synchronizes snippets across nodes by name. This endpoint triggers a force-start on all nodes using the specified snippet in their configuration profiles. ```APIDOC ## POST /api/snippets/actions/sync ### Description Synchronizes snippets across nodes by name. This endpoint searches configuration profiles for the provided snippet name and force-starts every node using an affected profile. ### Method POST ### Endpoint /api/snippets/actions/sync ### Parameters #### Request Body - **name** (string) - Required - The name of the snippet to synchronize. Must be 2-255 characters containing letters, numbers, underscores, dashes, and spaces. ### Response #### Success Response (202) - **status** (string) - Accepted ``` -------------------------------- ### Docker Hub Image Tag and Digest Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/dev/remnawave-3.2.0-vs-3.2.1-api-diff.md The OCI index reference for the Remnawave 3.2.1 backend image. ```text remnawave/backend:3.2.1 sha256:a6302ff950e1946a70c76567fe323dcd9a4f5f35d563510cf50ca4f64a52921f ``` -------------------------------- ### Import existing user metadata Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/user_metadata.md Commands to import existing metadata resources using either numeric IDs for Remnawave 3.0+ or UUIDs for 2.x. ```shell # Remnawave 3.0+ uses the numeric user ID. terraform import remnawave_user_metadata.info 42 # Remnawave 2.x uses the user UUID. terraform import remnawave_user_metadata.info 00000000-0000-0000-0000-000000000000 ``` -------------------------------- ### Run Repository Security Audits Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/repository-security.md Commands to verify repository security settings, including branch rulesets and environment policies. ```sh ./scripts/configure-repository-security.sh --check-solo # Or, after an independent reviewer is configured: ./scripts/configure-repository-security.sh --check ``` -------------------------------- ### Create a Remnawave VPN user Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/user.md Defines a new user with specific traffic limits, expiration, and device constraints. ```terraform resource "remnawave_user" "example" { username = "john-doe" expire_at = "2027-01-01T00:00:00.000Z" traffic_limit_bytes = 10737418240 # 10 GiB traffic_limit_strategy = "MONTH" description = "Managed by Terraform" tag = "CUSTOMER" hwid_device_limit = 3 } ``` -------------------------------- ### Create a subscription page config Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/subpage_config.md Defines a new subscription page configuration resource with a specified name. ```terraform resource "remnawave_subpage_config" "custom" { name = "Custom Subpage" } ``` -------------------------------- ### Acceptance Test Suite Execution Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/dev/remnawave-3.4.2-vs-3.4.3-api-diff.md Verification output showing the successful completion of the TestAcc suite against the 3.4.3 image. ```text PASS ok github.com/batonogov/terraform-provider-remnawave/provider 62.504s ``` -------------------------------- ### Import a Remnawave host Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/host.md Uses the terraform import command to bring an existing host into state management via its UUID. ```shell # Import a host by UUID. terraform import remnawave_host.vless 00000000-0000-0000-0000-000000000000 ``` -------------------------------- ### Import remnawave_node_metadata Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/node_metadata.md Imports existing node metadata into Terraform state using the node UUID. ```shell # Import node metadata by node UUID. terraform import remnawave_node_metadata.info 00000000-0000-0000-0000-000000000000 ``` -------------------------------- ### Import a remnawave_config_profile Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/config_profile.md Imports an existing configuration profile into the Terraform state using its UUID. ```shell # Import a config profile by UUID. terraform import remnawave_config_profile.default 00000000-0000-0000-0000-000000000000 ``` -------------------------------- ### Import a billing node Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/billing_node.md Uses the terraform import command to bring an existing billing node into state using its UUID. ```shell # Import a billing node by UUID. terraform import remnawave_billing_node.example 00000000-0000-0000-0000-000000000000 ``` -------------------------------- ### Import a shared list Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/shared_list.md Use the terraform import command to bring an existing shared list into state by its name. ```shell # Import a Remnawave 3.3+ global shared list by name (without ext:). terraform import remnawave_shared_list.private_ranges private_ranges ``` -------------------------------- ### Create a subscription template in Terraform Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/subscription_template.md Defines a new subscription template resource with a specified name and type. ```terraform resource "remnawave_subscription_template" "xray" { name = "Default XRAY_JSON" template_type = "XRAY_JSON" } ``` -------------------------------- ### Import a Node Plugin Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/node_plugin.md Imports an existing node plugin into Terraform state using its UUID. ```shell # Import a node plugin by UUID. terraform import remnawave_node_plugin.pre_start 00000000-0000-0000-0000-000000000000 ``` -------------------------------- ### Create a Remnawave infrastructure provider Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/infra_provider.md Defines a new infrastructure provider resource with required name and optional URL fields. ```terraform resource "remnawave_infra_provider" "example" { name = "Provider Co" favicon_link = "https://example.com/favicon.ico" login_url = "https://billing.example.com/login" } ``` -------------------------------- ### remnawave_infra_provider Resource Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/infra_provider.md The remnawave_infra_provider resource manages infrastructure provider configurations including name, favicon, and login URLs. ```APIDOC ## remnawave_infra_provider (Resource) ### Description Manages a Remnawave infrastructure provider for billing purposes. ### Schema #### Required - **name** (String) - Provider name (2-30 chars). #### Optional - **favicon_link** (String) - Favicon URL. - **login_url** (String) - Login URL. #### Read-Only - **uuid** (String) - Unique identifier for the provider. ### Import Import is supported using the terraform import command: `terraform import remnawave_infra_provider.example ` ``` -------------------------------- ### Import Existing Resources Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/README.md Commands to import resources created outside of Terraform into the state file using specific resource IDs. ```bash # Import a user by numeric ID on Remnawave 3.0+ terraform import remnawave_user.john 42 # Remnawave 2.x uses the user's UUID instead # terraform import remnawave_user.john 550e8400-e29b-41d4-a716-446655440000 # Import a node by UUID terraform import remnawave_node.de_fra_01 550e8400-e29b-41d4-a716-446655440001 # Import a passkey (import-only resource) terraform import remnawave_passkey.admin 550e8400-e29b-41d4-a716-446655440002 ``` -------------------------------- ### Acceptance Test Suite Results Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/dev/remnawave-3.2.0-vs-3.2.1-api-diff.md Output from the TestAcc suite verifying compatibility against the 3.2.1 image digest. ```text PASS ok github.com/batonogov/terraform-provider-remnawave/provider 118.138s ``` -------------------------------- ### remnawave_subscription_settings Resource Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/subscription_settings.md Configuration schema for the remnawave_subscription_settings resource. ```APIDOC ## remnawave_subscription_settings ### Description Manages Remnawave subscription settings (singleton). Delete only removes from Terraform state. ### Optional Parameters - **custom_remarks** (String) - Custom user-state remarks as JSON. - **custom_response_headers** (String) - Custom subscription response headers as a JSON object. - **happ_announce** (String) - Happ announce message (max 200 chars). - **happ_routing** (String) - Happ routing config. - **hwid_settings** (String) - HWID enforcement settings as JSON. - **is_profile_webpage_url_enabled** (Boolean) - Enable profile webpage URL. - **is_show_custom_remarks** (Boolean) - Show custom remarks for users. - **profile_title** (String) - Subscription profile title shown in VPN clients. - **profile_update_interval** (Number) - Subscription update interval in minutes. - **randomize_hosts** (Boolean) - Randomize host order in subscription. - **response_rules** (String) - Subscription response-rules configuration as JSON. - **serve_json_at_base_subscription** (Boolean) - Serve JSON at base subscription URL. - **support_link** (String) - Support link shown in subscription page. ### Read-Only Parameters - **id** (String) - Always 'settings' — this is a singleton resource. ### Import terraform import remnawave_subscription_settings.main settings ``` -------------------------------- ### Username and Password Authentication Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/README.md Configuring the provider using credentials for automatic JWT retrieval. ```hcl provider "remnawave" { endpoint = "https://panel.example.com" username = "admin" password = var.remnawave_password } ``` -------------------------------- ### Upgrade Terraform Provider Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/README.md Use this command to update the provider to the latest version. ```bash # Upgrade to the latest version terraform init -upgrade ``` -------------------------------- ### Provider Configuration Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/index.md Configures the remnawave provider with the necessary endpoint and authentication credentials. ```APIDOC ## Provider Configuration ### Description Configures the connection to the Remnawave panel. Authentication can be performed using an API token or administrator credentials. ### Schema - **endpoint** (String) - Required - Base URL of the Remnawave panel (e.g., https://panel.example.com). - **api_token** (String, Sensitive) - Optional - Pre-generated API token (JWT). If set, username/password are ignored. - **username** (String) - Optional - Remnawave admin username. - **password** (String, Sensitive) - Optional - Remnawave admin password. - **custom_headers** (Map of String, Sensitive) - Optional - Custom HTTP headers for requests. - **insecure_skip_verify** (Boolean) - Optional - Skip TLS certificate verification. - **proxy_headers** (Boolean) - Optional - Send X-Forwarded-For/X-Forwarded-Proto headers. - **request_timeout** (String) - Optional - HTTP request timeout (e.g., 30s, 1m). Default: 30s. ``` -------------------------------- ### Acceptance Test Results Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/dev/remnawave-3.2.1-vs-3.2.2-api-diff.md Output from the TestAcc suite verification against the 3.2.2 backend. ```text PASS ok github.com/batonogov/terraform-provider-remnawave/provider 121.450s ``` -------------------------------- ### API Token Authentication Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/README.md Configuring the provider using a static JWT API token. ```hcl provider "remnawave" { endpoint = "https://panel.example.com" api_token = var.remnawave_api_token } ``` -------------------------------- ### Define a remnawave_hwid_device resource Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/hwid_device.md Basic configuration for associating a device HWID with a user. ```terraform resource "remnawave_hwid_device" "phone" { user_uuid = remnawave_user.example.uuid hwid = "device-fingerprint-abc123" } ``` -------------------------------- ### Import a Remnawave node Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/node.md Uses the terraform import command to bring an existing node into state by its UUID. ```shell # Import a node by UUID on every supported Remnawave version. terraform import remnawave_node.de_fra_01 00000000-0000-0000-0000-000000000000 ``` -------------------------------- ### Retrieve and output shared list sizes Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/data-sources/shared_lists.md Fetches all available shared lists and iterates through them to display their names and item counts. ```terraform data "remnawave_shared_lists" "all" {} output "shared_list_sizes" { value = { for list in data.remnawave_shared_lists.all.shared_lists : list.name => list.items_count } } ``` -------------------------------- ### Import a Remnawave node integration Source: https://github.com/batonogov/terraform-provider-remnawave/blob/main/docs/resources/node_integration.md Imports an existing node integration into Terraform state using its UUID. ```shell # Import a Remnawave 3.3+ node integration by UUID. terraform import remnawave_node_integration.environment 00000000-0000-0000-0000-000000000000 ```