Skip to content

Commit 109647d

Browse files
committed
Add dotnet example
Signed-off-by: Alexander Dahmen <[email protected]>
1 parent 3b2a713 commit 109647d

File tree

14 files changed

+106
-0
lines changed

14 files changed

+106
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System.Collections.Generic;
2+
using Pulumi;
3+
using Pulumi.Stackit;
4+
5+
return await Deployment.RunAsync(async () =>
6+
{
7+
// Replace with your actual project ID and network ID
8+
string projectId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
9+
string networkId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
10+
11+
// Create arguments for getting the network
12+
var args = new GetNetworkArgs
13+
{
14+
ProjectId = projectId,
15+
NetworkId = networkId
16+
};
17+
18+
var networkResult = await GetNetwork.InvokeAsync(args);
19+
20+
// Export outputs here
21+
return new Dictionary<string, object?>
22+
{
23+
["outputKey"] = networkResult.Name
24+
};
25+
});
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: getNetworkExample
2+
description: A minimal C# Pulumi program
3+
runtime: dotnet
4+
config:
5+
pulumi:tags:
6+
value:
7+
pulumi:template: csharp
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<Nullable>enable</Nullable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Pulumi" Version="3.*" />
11+
<PackageReference Include="Pulumi.Stackit" Version="1.0.0" />
12+
</ItemGroup>
13+
14+
</Project>

0 commit comments

Comments
 (0)