A Terraform provider for Dokploy
Plugin-framework provider covering projects, environments, applications, Compose stacks, managed databases, domains, mounts, ports, redirects, basic auth, registries, SSH keys, certificates and backup destinations, over Dokploy's tRPC-over-REST API. The shim package exposes the provider to other Go modules, which is how pulumi-dokploy bridges it.
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
# Copyright IBM Corp. 2025, 2026
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
# Extract list resources supported by Terraform providers
|
||||
# Usage: ./list_resources.sh [provider_name]
|
||||
# Requires: terraform, jq
|
||||
# Note: Run from an initialized Terraform directory (terraform init)
|
||||
|
||||
set -e
|
||||
|
||||
PROVIDER=$1
|
||||
|
||||
# Ensure terraform is initialized
|
||||
if [ ! -d ".terraform" ]; then
|
||||
echo "Initializing Terraform..." >&2
|
||||
terraform init -upgrade > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
# Get provider schema and extract list_resource_schemas
|
||||
if [ -n "$PROVIDER" ]; then
|
||||
# Specific provider
|
||||
provider_key=$(terraform providers schema -json 2>/dev/null | jq -r '.provider_schemas | keys[]' | grep "/${PROVIDER}$" || true)
|
||||
if [ -n "$provider_key" ]; then
|
||||
terraform providers schema -json 2>/dev/null | jq -r \
|
||||
"{\"$PROVIDER\": (.provider_schemas.\"${provider_key}\" | .list_resource_schemas // {} | keys | sort)}"
|
||||
else
|
||||
echo "{\"$PROVIDER\": []}"
|
||||
fi
|
||||
else
|
||||
# All providers
|
||||
terraform providers schema -json 2>/dev/null | jq -r '
|
||||
.provider_schemas
|
||||
| to_entries
|
||||
| map({key: (.key | split("/")[-1]), value: (.value.list_resource_schemas // {} | keys | sort)})
|
||||
| from_entries
|
||||
'
|
||||
fi
|
||||
Reference in New Issue
Block a user