Skip to main content

Deploy containerized services to GCP with Pulumi.

Project description

Defang Pulumi Provider

GitHub tag (latest by date)

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:

{{< chooser language "typescript,python,go,dotnet,yaml" >}} {{% choosable language typescript %}}

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,
};

{{% /choosable %}}

{{% choosable language python %}}

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,
})

{{% /choosable %}}

{{% choosable language go %}}

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
	})
}

{{% /choosable %}}

{{% choosable language dotnet %}}

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 },
        },
    };
});

{{% /choosable %}}

{{% choosable language yaml %}}

# Pulumi.yaml provider configuration file
name: configuration-example
runtime: yaml
config:
    defang:Project:
        providerID: aws
        configPaths:
            - ./compose.yaml

{{% /choosable %}} {{< /chooser >}}

Installation and Configuration

See our Installation and Configuration docs

Development

See the Contributing doc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pulumi_defang_gcp-2.0.0a9.tar.gz (13.7 kB view details)

Uploaded Source

File details

Details for the file pulumi_defang_gcp-2.0.0a9.tar.gz.

File metadata

  • Download URL: pulumi_defang_gcp-2.0.0a9.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pulumi_defang_gcp-2.0.0a9.tar.gz
Algorithm Hash digest
SHA256 a156d10709df771b3e2f446efb37bb8bebddd5aa12a09097fd374bddd18ad3f9
MD5 857082673999f1d3925b34a8f877c735
BLAKE2b-256 d42f30d5d3ab9ebee16baf28c23b3f7fb44652ed2c3a62798af4fe2971d3bc89

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulumi_defang_gcp-2.0.0a9.tar.gz:

Publisher: release.yml on DefangLabs/pulumi-defang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page