Pulumi Crosswalk for AWS

Well-Architected Infrastructure as Code for AWS

The easiest way to build modern applications on AWS — from development to production.

Build and deploy modern cloud architectures on AWS quickly using reusable, well-architected patterns with infrastructure as code. Available in TypeScript/JavaScript, Python, Go, .NET, Java, and YAML.

Pulumi Crosswalk architecture
Easiest Way to AWS

Provision services that are Well-Architected by default. Benefit from patterns that worked for customers who have gone to production. Easy to get started, and easy to do the right thing.

Desktop to Production

Best in class productivity means you can rapidly deploy applications and infrastructure, with the confidence that what you build is production ready out-of-the-box.

Use Familiar Languages

Use familiar languages and your favorite tools. Pulumi supports TypeScript/JavaScript, Python, Go, .NET, Java, and YAML.

Modern Architectures like containers and serverless

Get up and running on "day one" with containers -- using Amazon Elastic Container Service (ECS), including "Fargate" or Kubernetes (EKS) -- or serverless -- using AWS Lambda or API Gateway. Benefit from secure and reliable defaults, and customize only where you need to.

With Pulumi's unique approach to infrastructure as code, you'll focus more on code and business logic, and less on DSL configuration languages.

Get Started

import * as awsx from "@pulumi/awsx";

// Spin up two instances of NGINX on port 80.
const lb = new awsx.lb.ApplicationListener("nginx", { port: 80 });
const nginx = new awsx.ecs.FargateService("nginx", {
    taskDefinitionArgs: {
        containers: {
            nginx: {
                image: "nginx",
                memory: 128,
                portMappings: [ lb ],
            },
        },
    },
    desiredCount: 2,
});

// Export the service's URL so that it's easy to access.
export const url = lb.endpoint.hostname;
import pulumi
import pulumi_awsx as awsx

// Spin up two instances of NGINX on port 80.
lb = awsx.lb.ApplicationListener("nginx", port=80)
nginx = awsx.ecs.FargateService("nginx",
	desired_count=2,
    task_definition_args=[awsx.ecs.FargateServiceTaskDefinitionArgs(
        containers: json.dumps({
            "nginx": {
                "image": "nginx",
                "memory": 128,
                "portMappings": [ lb ],
            },
        }),
    )],
)

pulumi.export("url", lb.endpoint.hostname)
package main

import (
    "github.com/pulumi/pulumi-awsx/sdk/go/awsx/ecs"
    "github.com/pulumi/pulumi-awsx/sdk/go/awsx/lb"
    "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
       lb, err := lb.NewApplicationListener(ctx, "nginx", &lb.ApplicationListenerArgs{
           Port: pulumi.Int(80),
       })
       if err != nil {
           return err
       }

       nginx, err := ecs.NewFargateService(ctx, "nginx", &ecs.FargateServiceArgs{
           DesiredCount: pulumi.Int(2),
           TaskDefinitionArgs: &ecs.TaskDefinitionArgs{
               Containers: map[string]TaskDefinitionContainerDefinitionArgs{
                   "nginx": {
                       Image: "nginx",
                       Memory: 128,
                       PortMappings: [ lb ],
                   },
               },
           },
       })
       if err != nil {
           return err
       }

       ctx.Export("url", lb.Endpoint.Hostname)
       return nil
    })
}
using Pulumi;
using Awsx = Pulumi.Awsx;

class MyStack : Stack
{
    public MyStack()
    {
        var lb = new Awsx.Lb.ApplicationListener("nginx", new Awsx.Lb.ApplicationListenerArgs
        {
            Port = 80,
        });

        var nginx = new Awsx.Ecs.FargateService("nginx", new Awsx.Ecs.FargateServiceArgs
        {
            DesiredCount = 2,
            TaskDefinitionArgs = new Awsx.Ecs.TaskDefinitionArgs
            {
                Containers = new Dictionary<string, Awsx.Ecs.TaskDefinitionContainerDefinitionArgs>
                {
                    {
                        "nginx",
                        new Awsx.Ecs.TaskDefinitionContainerDefinitionArgs
                        {
                            Image = "nginx",
                            Memory = 128,
                            PortMappings = { lb },
                        }
                    }
                }
            },
        });

        this.Url = lb.endpoint.hostname;
    }

    [Output]
    public Output<string> Url { get; set; }
}
package com.pulumi.example.infra;

import com.pulumi.Context;
import com.pulumi.Exports;
import com.pulumi.Pulumi;
import com.pulumi.awsx.lb.ApplicationListener;
import com.pulumi.awsx.lb.ApplicationListenerArgs;
import com.pulumi.awsx.ecs.FargateService;
import com.pulumi.awsx.ecs.FargateServiceArgs;
import com.pulumi.awsx.ecs.TaskDefinitionArgs;
import com.pulumi.awsx.ecs.TaskDefinitionContainerDefinitionArgs;
import java.util.HashMap;

public class Main {

    public static void main(String[] args) {
        Pulumi.run(Main::stack);
    }

    private static Exports stack(Context ctx) {
        var lb = new ApplicationListener("nginx", ApplicationListenerArgs.builder()
                    .port(80)
                    .build());

        var nginx = new FargateService("nginx", FargateServiceArgs.builder()
                    .desiredCount(2)
                    .taskDefinitionArgs(TaskDefinitionArgs.builder()
                                .containers(new HashMap<String, TaskDefinitionContainerDefinitionArgs>(){
                                    {
                                        put("nginx", TaskDefinitionContainerDefinitionArgs.builder()
                                            .image("")
                                            .memory(128)
                                            .portMappings(new ApplicationListener[]{lb})
                                            .build()),
                                    }
                                })
                                .build())
                    .build());

        ctx.export("url", lb.endpoint.hostname);
        return ctx.exports();
    }
}
name: awsx-fargate-service
runtime: yaml
description: A simple Pulumi program.
resources:
  lb:
      type: awsx:lb:ApplicationListener
      properties:
          port: 80
  nginx:
      type: awsx:ecs:FargateService
      properties:
          desiredCount: 2
          taskDefinitionArgs:
              containers:
                  nginx:
                      image: "nginx"
                      memory: 128
                      portMappings: [ ${lb} ]
outputs:
  url: ${lb.endpoint.hostname}

Secure, Scalable, and Observable Architectures

Create, manage, and integrate "day two and beyond" infrastructure for security (e.g., IAM), networking (e.g., VPC), scaling (e.g., Auto Scaling, ELB), and monitoring (e.g., CloudWatch and CloudWatch Logs). Instead of relearning best practices time and time again, use hardened packages that automatically encapsulate Well-Architected patterns and practices.

Pulumi's unique approach to infrastructure as code means you can leverage highly configurable and extensible components to enforce best practices within your team.

Get Started

import * as awsx from "@pulumi/awsx";

const vpc = new awsx.vpc.Vpc('my-vpc', {});

export const vpcId = vpc.id;
export const vpcPrivateSubnetIds = vpc.privateSubnetIds;
export const vpcPublicSubnetIds = vpc.publicSubnetIds;
import pulumi
import pulumi_awsx as awsx

vpc = pulumi_awsx.vpc.Vpc("my-vpc")

pulumi.export("vpcId", vpc.id)
pulumi.export("vpcPrivateSubnetIds", vpc.privateSubnetIds)
pulumi.export("publicSubnetIds", vpc.publicSubnetIds)
package main

import (
    "github.com/pulumi/pulumi-awsx/sdk/go/awsx/vpc"
    "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        vpc, err := vpc.Vpc(ctx, "my-vpc", nil)
        if err != nil {
            return err
        }

        ctx.Export("vpcId", vpc.ID)
        ctx.Export("vpcPrivateSubnetIds", vpc.PrivateSubnetIDs)
        ctx.Export("vpcPublicSubnetIds", vpc.PublicSubnetIDs)
        return nil
    })
}
using Pulumi;
using Awsx = Pulumi.Awsx;

class MyStack : Stack
{
    public MyStack()
    {
        var vpc = Awsx.Vpc.Vpc("my-vpc", new Awsx.Vpc.VpcArgs());

        this.VpcId = vpc.id;
        this.VpcPrivateSubnetIds = vpc.privateSubnetIds;
        this.VpcPublicSubnetIds = vpc.publicSubnetIds;
    }

    [Output]
    public Output<string> VpcId { get; set; }

    [Output]
    public Output<string> VpcPrivateSubnetIds { get; set; }

    [Output]
    public Output<string> VpcPublicSubnetIds { get; set; }
}
package com.pulumi.example.infra;

import com.pulumi.Context;
import com.pulumi.Exports;
import com.pulumi.Pulumi;
import com.pulumi.awsx.vpc.Vpc;
import com.pulumi.awsx.vpc.VpcArgs;

public class Main {

    public static void main(String[] args) {
        Pulumi.run(Main::stack);
    }

    private static Exports stack(Context ctx) {
        var vpc = new Vpc("my-vpc, VpcArgs.builder().build());

        ctx.export("vpcId", vpc.id);
        ctx.export("vpcPrivateSubnetIds", vpc.privateSubnetIds);
        ctx.export("vpcPublicSubnetIds", vpc.publicSubnetIds);
        return ctx.exports();
    }
}
name: awsx-vpc
runtime: yaml
description: A simple Pulumi program.
resources:
    vpc:
        type: awsx:vpc:Vpc
outputs:
    vpcId: ${vpc.id}
    vpcPrivateSubnetIds: ${vpc.privateSubnetIds}
    vpcPublicSubnetIds: ${vpc.publicSubnetIds}

We've been happily using Pulumi's EKS support for more than three months now. Our team was looking for an end-to-end solution to tame the complexity of Kubernetes on AWS and ensure we adhere to AWS best practices. Pulumi's Crosswalk effort has equipped our team to scale far better than the alternative approaches of home-grown solutions, scripts and DSLs. Our delivery is now automated and we can now deliver new application and infrastructure features with much faster turn-around, sometimes in just a few hours. Pulumi is a key contributor to our team's improvement in productivity.

Pankaj Dhingra

Senior Director of Cloud Engineering