1. Packages
  2. Packages
  3. Defang Providers
Viewing docs for Defang AWS v2.4.1
published on Saturday, Jul 11, 2026 by Defang

Defang Providers

defang-aws logo
Viewing docs for Defang AWS v2.4.1
published on Saturday, Jul 11, 2026 by Defang

    Defang Pulumi Providers

    GitHub tag (latest by date)

    The Pulumi Providers for Defang — Take your app from Docker Compose to a secure and scalable cloud deployment with Pulumi.

    Defang ships one provider package per cloud, all with the same Compose-shaped inputs:

    • defang-aws — deploys to AWS (ECS Fargate, ALB, RDS, ElastiCache, …)
    • defang-gcp — deploys to Google Cloud (Cloud Run / Compute Engine, Cloud SQL, Memorystore, …)
    • defang-azure — deploys to Azure (Container Apps, Azure Database, Azure Cache, …)

    The examples below use defang-aws; swap in the defang-gcp or defang-azure package of your language to target another cloud — the Project inputs are the same.

    Example usage

    You can find complete working TypeScript, Python, Go, .NET, and Yaml code samples for every cloud in the ./examples directory, and some example snippets below:

    import * as pulumi from "@pulumi/pulumi";
    import * as defang_aws from "@defang-io/pulumi-defang-aws";
    
    const awsDemo = new defang_aws.Project("aws-demo", {
        services: {
            app: {
                image: "nginx",
                ports: [{
                    target: 80,
                    mode: "ingress",
                    appProtocol: "http",
                }],
            },
        },
    });
    export const endpoints = awsDemo.endpoints;
    
    import pulumi
    import pulumi_defang_aws as defang_aws
    
    aws_demo = defang_aws.Project("aws-demo", services={
        "app": {
            "image": "nginx",
            "ports": [{
                "target": 80,
                "mode": "ingress",
                "app_protocol": "http",
            }],
        },
    })
    pulumi.export("endpoints", aws_demo.endpoints)
    
    package main
    
    import (
    	defangaws "github.com/DefangLabs/pulumi-defang/sdk/v2/go/defang-aws"
    	"github.com/DefangLabs/pulumi-defang/sdk/v2/go/defang-aws/compose"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		awsDemo, err := defangaws.NewProject(ctx, "aws-demo", &defangaws.ProjectArgs{
    			Services: compose.ServiceConfigMap{
    				"app": &compose.ServiceConfigArgs{
    					Image: pulumi.String("nginx"),
    					Ports: compose.ServicePortConfigArray{
    						&compose.ServicePortConfigArgs{
    							Target:      pulumi.Int(80),
    							Mode:        pulumi.String("ingress"),
    							AppProtocol: pulumi.String("http"),
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		ctx.Export("endpoints", awsDemo.Endpoints)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using Pulumi;
    using DefangAws = DefangLabs.DefangAws;
    
    return await Deployment.RunAsync(() =>
    {
        var awsDemo = new DefangAws.Project("aws-demo", new()
        {
            Services =
            {
                { "app", new DefangAws.Compose.Inputs.ServiceConfigArgs
                {
                    Image = "nginx",
                    Ports = new[]
                    {
                        new DefangAws.Compose.Inputs.ServicePortConfigArgs
                        {
                            Target = 80,
                            Mode = "ingress",
                            AppProtocol = "http",
                        },
                    },
                } },
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["endpoints"] = awsDemo.Endpoints,
        };
    });
    
    name: defang-aws-example
    runtime: yaml
    description: Example using defang-aws to deploy services to AWS
    
    resources:
      aws-demo:
        type: defang-aws:index:Project
        properties:
          services:
            app:
              image: nginx
              ports:
                - target: 80
                  mode: ingress
                  appProtocol: http
    
    outputs:
      endpoints: ${aws-demo.endpoints}
    

    Installation and Configuration

    See our Installation and Configuration docs

    Development

    See the Contributing doc.

    defang-aws logo
    Viewing docs for Defang AWS v2.4.1
    published on Saturday, Jul 11, 2026 by Defang

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial