2022-10-09 14:48:16 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2023-01-06 22:39:16 +00:00
|
|
|
"os"
|
2022-10-09 14:48:16 +00:00
|
|
|
|
|
|
|
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
|
|
|
)
|
|
|
|
|
|
|
|
func readFileOrPanic(path string) pulumi.StringPtrInput {
|
2023-01-06 22:39:16 +00:00
|
|
|
data, err := os.ReadFile(path)
|
2022-10-09 14:48:16 +00:00
|
|
|
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
|
|
|
|
})
|
|
|
|
}
|