Skip to main content

Deploy containerized services to AWS 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 defangaws from "@defang-io/pulumi-defang-aws";

const project = new defangaws.Project("aws-nodejs", {
    services: {
        app: {
            image: "nginx",
            ports: [{
                target: 80,
                mode: "ingress",
                appProtocol: "http",
            }],
        },
    },
});

export const endpoints = project.endpoints;

{{% /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 (
	defangaws "github.com/DefangLabs/pulumi-defang/sdk/go/defang-aws"
	"github.com/DefangLabs/pulumi-defang/sdk/go/defang-aws/shared"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		proj, err := defangaws.NewProject(ctx, "aws-go", &defangaws.ProjectArgs{
			Services: shared.ServiceInputMap{
				"app": shared.ServiceInputArgs{
					Image: pulumi.String("nginx:latest"),
					Ports: shared.PortConfigArray{
						shared.PortConfigArgs{
							Target:      pulumi.Int(80),
							Mode:        pulumi.StringPtr("ingress"),
							AppProtocol: pulumi.StringPtr("http"),
						},
					},

				},
		})
		if err != nil {
			return err
		}

		ctx.Export("endpoints", proj.Endpoints)

		return nil
	})
}

{{% /choosable %}}

{{% choosable language dotnet %}}

using System.Collections.Generic;
using Pulumi;
using DefangLabs.DefangAws;
using DefangLabs.DefangAws.Shared.Inputs;

return await Deployment.RunAsync(() =>
{
    var project = new Project("aws-dotnet", new ProjectArgs
    {
        Services =
        {
            ["app"] = new ServiceInputArgs
            {
                Image = "nginx",
                Ports =
                {
                    new PortConfigArgs { Target = 80, Mode = "ingress", AppProtocol = "http" },
                },
            },
        },
    });

    return new Dictionary<string, object?>
    {
        ["endpoints"] = project.Endpoints,
    };
});

{{% /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_aws-2.0.0a14.tar.gz (15.0 kB view details)

Uploaded Source

File details

Details for the file pulumi_defang_aws-2.0.0a14.tar.gz.

File metadata

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

File hashes

Hashes for pulumi_defang_aws-2.0.0a14.tar.gz
Algorithm Hash digest
SHA256 4ab7fbfc5ad1a5b70b4d8148b1f8a3797c85740b7ff202cac3b7d07f6c922d2c
MD5 7c285def257118ad7e349444c4054a6d
BLAKE2b-256 1f9c28b683966d65883c1fb48ecc49a5bf819fed6dd8e1dc4944d224076e0f59

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulumi_defang_aws-2.0.0a14.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