Initial commit
This commit is contained in:
6
examples/go/Pulumi.yaml
Normal file
6
examples/go/Pulumi.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
name: provider-xyz-native
|
||||
runtime: go
|
||||
plugins:
|
||||
providers:
|
||||
- name: xyz
|
||||
path: ../../bin
|
||||
7
examples/go/go.mod
Normal file
7
examples/go/go.mod
Normal file
@@ -0,0 +1,7 @@
|
||||
module provider-xyz-native
|
||||
|
||||
go 1.20
|
||||
|
||||
require (
|
||||
github.com/pulumi/pulumi/sdk/v3 v3.30.0
|
||||
)
|
||||
21
examples/go/main.go
Normal file
21
examples/go/main.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/pulumi/pulumi-xyz/sdk/go/xyz"
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||
)
|
||||
|
||||
func main() {
|
||||
pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
myRandomResource, err := xyz.NewRandom(ctx, "myRandomResource", &xyz.RandomArgs{
|
||||
Length: pulumi.Int(24),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ctx.Export("output", map[string]interface{}{
|
||||
"value": myRandomResource.Result,
|
||||
})
|
||||
return nil
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user