defang v1.0.0 published on Monday, Mar 24, 2025 by Defang
Defang Provider
Defang Pulumi Provider
The Pulumi Provider for Defang — Take your app from Docker Compose to a secure and scalable cloud deployment with Pulumi.
Example usage
You can find complete working TypeScript, Python, Go, .NET, and Yaml code samples in the ./examples
directory, and some example snippets below:
import * as pulumi from "@pulumi/pulumi";
import * as defang from "@defang-io/pulumi-defang";
const myProject = new defang.Project("myProject", {
providerID: "aws",
configPaths: ["compose.yaml"],
});
export const output = {
albArn: myProject.albArn,
etag: myProject.etag,
};
import pulumi
import pulumi_defang as defang
my_project = defang.Project("myProject",
provider_id="aws",
config_paths=["compose.yaml"])
pulumi.export("output", {
"albArn": my_project.alb_arn,
"etag": my_project.etag,
})
package main
import (
"example.com/pulumi-defang/sdk/go/defang"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
myProject, err := defang.NewProject(ctx, "myProject", &defang.ProjectArgs{
ProviderID: pulumi.String("aws"),
ConfigPaths: pulumi.StringArray{
pulumi.String("compose.yaml"),
},
})
if err != nil {
return err
}
ctx.Export("output", pulumi.StringMap{
"albArn": myProject.AlbArn,
"etag": myProject.Etag,
})
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Defang = DefangLabs.Defang;
return await Deployment.RunAsync(() =>
{
var myProject = new Defang.Project("myProject", new()
{
ProviderID = "aws",
ConfigPaths = new[]
{
"./compose.yaml",
},
});
return new Dictionary<string, object?>
{
["output"] =
{
{ "albArn", myProject.AlbArn },
{ "etag", myProject.Etag },
},
};
});
# Pulumi.yaml provider configuration file
name: configuration-example
runtime: yaml
config:
defang:Project:
providerID: aws
configPaths:
- ./compose.yaml
Installation and Configuration
See our Installation and Configuration docs
Development
See the Contributing doc.