pulumi/sdk/dotnet
Matt Ellis 9de9ad2f97 Pass dependency information to the engine
Dependency information can come from one of two places, an explicit
set of resources that you depend on (via the ResourceOptions struct)
and dependencies we infer from output tracking.
2018-06-22 16:53:21 -07:00
..
Pulumi Pass dependency information to the engine 2018-06-22 16:53:21 -07:00
Pulumirpc The very first cut of .NET Support 2018-06-18 08:46:47 -07:00
cmd/pulumi-language-dotnet Remove Pulumi.Host and CSI, in favor of `dotnet run` 2018-06-21 10:50:08 -07:00
examples/bucket Add Output<T> 2018-06-22 14:23:58 -07:00
.gitignore The very first cut of .NET Support 2018-06-18 08:46:47 -07:00
README.md Start using Task<T> to model outputs 2018-06-18 13:40:48 -07:00
build-and-run.sh Add Output<T> 2018-06-22 14:23:58 -07:00
dotnet.sln Remove Pulumi.Host and CSI, in favor of `dotnet run` 2018-06-21 10:50:08 -07:00

README.md

Experimental .NET Language Provider

An early prototype of a .NET language provider for Pulumi.

Building and Running

To build, you'll want to install the .NET Core SDK, and ensure dotnet is on your path. I'm using the 2.1 SDK, but I believe any 2.0+ SDK will work.

$ dotnet build should build the relevent libraries.

You'll also need to build the language host, which is written in Golang and handles launching pulumi-language-dotnet-exec.

$ GOBIN=/opt/pulumi/bin go install ./cmd/pulumi-language-dotnet

Add the Publish Pulumi.Host and add the folder to you $PATH:

$ dotnet publish Pulumi.Host/pulumi-language-dotnet-exec.csproj
$ export PATH=$(go env GOPATH)/src/github.com/pulumi/pulumi/sdk/dotnet/Pulumi.Host/bin/Debug/netcoreapp2.0/publish:$PATH

Write a little sample app as a csharp script. You have to include the full Path to Pulumi.dll in your reference.

$ cat main.csx 

#r "/home/matell/go/src/github.com/pulumi/pulumi/sdk/dotnet/Pulumi/bin/Debug/netstandard2.0/Pulumi.dll"
using Pulumi;
using System;

Config config = new Config("hello-dotnet");
CustomResource r = new CustomResource("aws:s3/bucket:Bucket", config["name"]);

Make a Pulumi.yaml file:

$ cat Pulumi.yaml

name: hello-dotnet
runtime: dotnet

Then, configure it:

$ pulumi stack init hello-dotnet
$ pulumi config set name hello-dotnet
$ pulumi config set aws:region us-west-2

And finally, preview and update as you would any other Pulumi project.