mirror of https://github.com/pulumi/pulumi.git
![]() Fixes:#6565 As part of #6460, the logic for determing the version of the build was moved to be a dependency on pulumictl. Unfortunately, the homebrew installs use the "make dist" command to build + install Pulumi to the user maching and as that would have a dependency on pulumictl and it not existing on the user machine, it would pass an empty version to the ldflag This then manifested to the user as: ``` ▶ pulumi version warning: A new version of Pulumi is available. To upgrade from version '0.0.0' to '2.22.0', run $ brew upgrade pulumi or visit https://pulumi.com/docs/reference/install/ for manual instructions and release notes. ``` We are able to mitigate this behaviour by bringing back the get-version script and using that script as part of the make brew installation We can see that the versions are the same between the 2 different installation techniques ``` make dist <------- uses pulumict DIST: go install -ldflags "-X github.com/pulumi/pulumi/sdk/v2/go/common/version.Version=2.24.0-alpha.1616029310+787eb70a" github.com/pulumi/pulumi/sdk/v2/dotnet/cmd/pulumi-language-dotnet DIST: BUILD: ``` ``` make brew <----- uses the legacy script ▶ make brew BREW: go install -ldflags "-X github.com/pulumi/pulumi/sdk/v2/go/common/version.Version=v2.24.0-alpha.1616029310+g787eb70a2" github.com/pulumi/pulumi/sdk/v2/dotnet/cmd/pulumi-language-dotnet BREW: ``` A full post mortem will be carried out to ensure we mitigate these types of errors going forward and that we are able to better test these types of situations |
||
---|---|---|
.. | ||
Pulumi | ||
Pulumi.Automation | ||
Pulumi.Automation.Tests | ||
Pulumi.FSharp | ||
Pulumi.Tests | ||
cmd/pulumi-language-dotnet | ||
.editorconfig | ||
.gitignore | ||
Makefile | ||
README.md | ||
dotnet.sln | ||
pulumi_logo_64x64.png |
README.md
.NET Language Provider
A .NET language provider for Pulumi.
Building and Running
To build, you'll want to install the .NET Core 3.0 SDK or greater, and ensure
dotnet
is on your path. Once that it does, running make
in either the root
directory or the sdk/dotnet
directory will build and install the language
plugin.
Once this is done you can write a Pulumi app written on top of .NET. You can find
many examples showing how this can be done with C#, F#, or VB.
Your application will need to reference the Pulumi NuGet package
or the Pulumi.dll
built above.
Here's a simple example of a Pulumi app written in C# that creates some simple AWS resources:
// Copyright 2016-2019, Pulumi Corporation
using System.Collections.Generic;
using System.Threading.Tasks;
using Pulumi;
using Pulumi.Aws.S3;
class Program
{
static Task<int> Main()
=> Deployment.RunAsync(() =>
{
var config = new Config("hello-dotnet");
var name = config.Require("name");
// Create the bucket, and make it public.
var bucket = new Bucket(name, new BucketArgs { Acl = "public-read" });
// Add some content.
var content = new BucketObject($"{name}-content", new BucketObjectArgs
{
Acl = "public-read",
Bucket = bucket.Id,
ContentType = "text/plain; charset=utf8",
Key = "hello.txt",
Source = new StringAsset("Made with ❤, Pulumi, and .NET"),
});
// Return some values that will become the Outputs of the stack.
return new Dictionary<string, object>
{
{ "hello", "world" },
{ "bucket-id", bucket.Id },
{ "content-id", content.Id },
{ "object-url", Output.Format($"http://{bucket.BucketDomainName}/{content.Key}") },
};
});
}
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.