Pulumi .NET
The official Pulumi .NET SDK for defining cloud infrastructure as code using C#, F#, or VB.NET. Instead of YAML or DSL configs, you write real code to provision and manage resources across AWS, Azure, Google Cloud, Kubernetes, and more.
Features
- Define infrastructure in C# with full IDE support, type safety, and refactoring tools
- Supports all major cloud providers (AWS, Azure, Google Cloud, Kubernetes)
- Reuse existing .NET libraries and NuGet packages in your infrastructure code
- Built-in secret management for sensitive configuration values
- Stack-based environment management (dev, staging, prod)
- Preview changes before applying with
pulumi preview - State management via Pulumi Cloud or self-hosted backends
Usage
Create an Azure resource group and storage account in C#:
using Pulumi;
using Pulumi.AzureNative.Resources;
using Pulumi.AzureNative.Storage;
return await Deployment.RunAsync(() =>
{
var resourceGroup = new ResourceGroup("myResourceGroup");
var storageAccount = new StorageAccount("mystorage", new StorageAccountArgs
{
ResourceGroupName = resourceGroup.Name,
Sku = new SkuArgs { Name = SkuName.Standard_LRS },
Kind = Kind.StorageV2,
});
return new Dictionary<string, object?>
{
["storageAccountName"] = storageAccount.Name
};
});
CLI Workflow
# Create a new project
pulumi new azure-csharp
# Preview changes
pulumi preview
# Deploy
pulumi up
# Tear down
pulumi destroy
Use Cases
- Provisioning cloud infrastructure using the same language as your application code
- Managing multi-environment deployments with stack-scoped configuration
- Replacing Terraform or Bicep with a code-first approach
- Building reusable infrastructure components as NuGet packages
Ready to get started? Visit the official site to learn more.
Visit official site north_east