almost empty
This commit is contained in:
12
examples/basic/PklProject
Normal file
12
examples/basic/PklProject
Normal file
@@ -0,0 +1,12 @@
|
||||
amends "pkl:Project"
|
||||
|
||||
dependencies {
|
||||
// Reference local plugin schema during development
|
||||
// IMPORTANT: The alias must match the package name from the schema's PklProject
|
||||
["proxmox"] = import("../../schema/pkl/PklProject")
|
||||
|
||||
// Formae schema - fetched from public registry
|
||||
["formae"] {
|
||||
uri = "package://hub.platform.engineering/plugins/pkl/schema/pkl/formae/formae@0.80.0"
|
||||
}
|
||||
}
|
||||
46
examples/basic/main.pkl
Normal file
46
examples/basic/main.pkl
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Basic Example
|
||||
*
|
||||
* This example shows how to define resources using your plugin.
|
||||
* Run with: formae apply --mode reconcile --watch examples/basic/main.pkl
|
||||
*/
|
||||
amends "@formae/forma.pkl"
|
||||
|
||||
import "@formae/formae.pkl"
|
||||
import "@proxmox/proxmox.pkl"
|
||||
|
||||
forma {
|
||||
new formae.Stack {
|
||||
label = "default"
|
||||
description = "Default stack for example resources"
|
||||
}
|
||||
|
||||
new formae.Target {
|
||||
label = "my-target"
|
||||
namespace = "PROXMOX"
|
||||
// Add your provider-specific configuration here
|
||||
// For typed config, create a Config class in your schema:
|
||||
// config = new example.Config { region = "us-east-1" }
|
||||
config = new Mapping {
|
||||
["region"] = "us-east-1"
|
||||
}
|
||||
}
|
||||
|
||||
new example.ExampleResource {
|
||||
label = "my-resource"
|
||||
name = "My Example Resource"
|
||||
description = "This is an example resource"
|
||||
region = "us-east-1"
|
||||
|
||||
endpoint = new example.Endpoint {
|
||||
url = "https://api.example.com"
|
||||
port = 8080
|
||||
protocol = "https"
|
||||
}
|
||||
|
||||
tags = new Listing {
|
||||
new example.Tag { key = "Environment"; value = "development" }
|
||||
new example.Tag { key = "Team"; value = "platform" }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user