Deploy containerized services to GCP with Pulumi.
Project description
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
The examples below use AWS. GCP and Azure follow the same pattern — just swap the package name (e.g. defang-aws → defang-gcp).
Complete working samples for all clouds and languages are in the ./examples directory.
{{< chooser language "typescript,python,go,dotnet,yaml" >}} {{% choosable language typescript %}}
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;
{{% /choosable %}}
{{% choosable language python %}}
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)
{{% /choosable %}}
{{% choosable language go %}}
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
})
}
{{% /choosable %}}
{{% choosable language dotnet %}}
using System.Collections.Generic;
using System.Linq;
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,
};
});
{{% /choosable %}}
{{% choosable language yaml %}}
name: defang-aws
runtime: yaml
description: Example using defang-aws to deploy services to AWS
plugins:
providers:
- name: defang-aws
path: ../../bin
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}
{{% /choosable %}} {{< /chooser >}}
Installation and Configuration
See our Installation and Configuration docs
Development
See the Contributing doc.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pulumi_defang_gcp-2.0.0a18.tar.gz.
File metadata
- Download URL: pulumi_defang_gcp-2.0.0a18.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eeadcae2ed86504d36fed417b7caa7228d144dd3fb2498b06385fdc063fca487
|
|
| MD5 |
3daf0dad9e1c01bb5f2b6d96a1b68d6f
|
|
| BLAKE2b-256 |
249184a5c54c9f1d9c34654186080d1bcfb9409d50325d79e5bf7462c6cf37dc
|
Provenance
The following attestation bundles were made for pulumi_defang_gcp-2.0.0a18.tar.gz:
Publisher:
release.yml on DefangLabs/pulumi-defang
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pulumi_defang_gcp-2.0.0a18.tar.gz -
Subject digest:
eeadcae2ed86504d36fed417b7caa7228d144dd3fb2498b06385fdc063fca487 - Sigstore transparency entry: 1323411981
- Sigstore integration time:
-
Permalink:
DefangLabs/pulumi-defang@a87cb61ecee3a8c6676c1b03eea441111c6d1e80 -
Branch / Tag:
refs/tags/v2.0.0-alpha.18 - Owner: https://github.com/DefangLabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a87cb61ecee3a8c6676c1b03eea441111c6d1e80 -
Trigger Event:
push
-
Statement type: