mirror of https://github.com/pulumi/pulumi.git
24 lines
391 B
Go
24 lines
391 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
|
)
|
|
|
|
func readFileOrPanic(path string) pulumi.StringPtrInput {
|
|
data, err := os.ReadFile(path)
|
|
if err != nil {
|
|
panic(err.Error())
|
|
}
|
|
return pulumi.String(string(data))
|
|
}
|
|
|
|
func main() {
|
|
pulumi.Run(func(ctx *pulumi.Context) error {
|
|
key := readFileOrPanic("key.pub")
|
|
ctx.Export("result", key)
|
|
return nil
|
|
})
|
|
}
|