pulumi/sdk/dotnet
bors[bot] 159988df49
Merge #11143
11143: [dotnet/auto] allow deserializing complex stack config values r=Zaid-Ajaj a=Zaid-Ajaj

<!--- 
Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. -->

Fixes #11107 now instead of failing, we JSON-ify the complex stack config value 

## Checklist

<!--- Please provide details if the checkbox below is to be left unchecked. -->
- [x] I have added tests that prove my fix is effective or that my feature works
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the Pulumi Service,
then the service should honor older versions of the CLI where this change would not exist.
You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->


Co-authored-by: Zaid Ajaj <zaid.naom@gmail.com>
2022-10-26 18:47:56 +00:00
..
Pulumi Simplify the format of docs comment of Output<T> 2022-10-26 17:07:31 +02:00
Pulumi.Automation Merge #11143 2022-10-26 18:47:56 +00:00
Pulumi.Automation.Tests [dotnet/auto] allow deserializing complex stack config values 2022-10-25 13:59:20 +02:00
Pulumi.FSharp Pin FSharp.Core to >= 4.7.2 (#10311) 2022-08-04 14:46:55 +02:00
Pulumi.Tests [dotnet/sdk] Implement Deployment.TestAsync overloads which accept functions (#10458) 2022-08-30 13:13:25 +02:00
cmd/pulumi-language-dotnet chore: Update doc comments, coding style, fix lint 2022-10-13 13:50:49 -07:00
.editorconfig Add **preview** .NET Core support for pulumi. (#3399) 2019-10-25 16:59:50 -07:00
.gitignore [Automation API] - C# Implementation (#5761) 2021-02-18 11:36:21 +01:00
Makefile ci: Enable testing of language version sets 2022-09-21 09:48:38 -07:00
README.md feat(automation): Add options to configure logging, tracing (#10338) 2022-08-11 23:30:45 -07:00
dotnet.sln [Automation API] - C# Implementation (#5761) 2021-02-18 11:36:21 +01:00
dotnet.sln.DotSettings [dotnet] Fix Resharper code issues (#7178) 2021-06-10 10:32:33 -04:00
pulumi_logo_64x64.png Fixing up Pulumi logo in dotnet package 2021-04-21 18:45:21 +01:00

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.

Public API Changes

When making changes to the code you may get the following compilation error:

error RS0016: Symbol XYZ' is not part of the declared API.

This indicates a change in public API. If you are developing a change and this is intentional, add the new API elements to PublicAPI.Shipped.txt corresponding to your project (some IDEs will do this automatically for you, but manual additions are fine as well).