mirror of https://github.com/pulumi/pulumi.git
248f78bafe
Add support to the core SDKs for reporting resource source positions. In each SDK, this is implemented by crawling the stack when a resource is registered in order to determine the position of the user code that registered the resource. This is somewhat brittle in that it expects a call stack of the form: - Resource class constructor - abstract Resource subclass constructor - concrete Resource subclass constructor - user code This stack reflects the expected class hierarchy of "cloud resource / component resource < customresource/componentresource < resource". For example, consider the AWS S3 Bucket resource. When user code instantiates a Bucket, the stack will look like this in NodeJS: new Resource (/path/to/resource.ts:123:45) new CustomResource (/path/to/resource.ts:678:90) new Bucket (/path/to/bucket.ts:987:65) <user code> (/path/to/index.ts:4:3) In order to determine the source position, we locate the fourth frame (the `<user code>` frame). |
||
---|---|---|
.. | ||
auto | ||
common | ||
pulumi | ||
pulumi-language-go | ||
Makefile | ||
README.md |
README.md
Pulumi Golang SDK
This directory contains support for writing Pulumi programs in the Go language. There are two aspects to this:
pulumi/
contains the client language bindings Pulumi program's code directly against;pulumi-language-go/
contains the language host plugin that the Pulumi engine uses to orchestrate updates.
To author a Pulumi program in Go, simply say so in your Pulumi.yaml
name: <my-project>
runtime: go
and ensure you have pulumi-language-go
on your path (it is distributed in the Pulumi download automatically).
By default, the language plugin will use your project's name, <my-project>
, as the executable that it loads. This too
must be on your path for the language provider to load it when you run pulumi preview
or pulumi up
.