Pulumi Crosswalk, released June 11, 2019, is an open source library of components for supporting AWS infrastructure as code. Crosswalk aims to improve the developer experience when creating applications in AWS by enabling developers to declare AWS resources with common programming languages, such as JavaScript. Pulumi's SaaS works with language-specific SDKs to enable a consistent workflow for provisioning AWS resources such as containers, serverless functions, and other cloud infrastructure.
Pulumi provides a cloud native development platform for creating, deploying, and managing cloud infrastructure. Unlike tools such as CloudFormation or Terraform, which rely on YAML based configuration files, Pulumi lets developers use existing programming languages to create and interact with application infrastructure. Pulumi currently supports SDKs for JavaScript, Python, TypeScript and Go and works across several cloud provides such as Amazon AWS, Google GCP, and Microsoft Azure.
Crosswalk offers an end-to-end approach for building on the AWS platform with the Pulumi SDKs and reusable abstractions. Specifically for AWS, Crosswalk was designed to make best practices accessible, such working with VPCs, and make it easier to get started with AWS applications. Crosswalk provides an aligned interface for interacting across AWS resources and the central components are serverless, containers, and continuous delivery. Crosswalk is built on top of AWS primitives, so users can implement any of the services AWS offers.
Pulumi Crosswalk for AWS, from the Pulumi blog
The design and potential benefits of Crosswalk can be highlighted with an example serverless application that uses API Gateway for ingress and Lambda for execution. The following code example is based on a sample Slackbot from the Pulumi project repository.
import * as awsx from "@pulumi/awsx";
// Create an API endpoint that slack will use to push events to us with.
const endpoint = new awsx.apigateway.API("mentionbot", {
routes: [{
path: "/events",
method: "POST",
eventHandler: async (event) => {
// process the different types of messages.
return { statusCode: 200, body: "" };
},
}],
});
The application sets up an endpoint by creating a new API Gateway route that Slack will send a message to, which triggers a Lambda function to process the message. The Crosswalk "awsx" library is used to define an API Gateway route and a Lambda is created with the provided event handler JavaScript function. This function can access the other resources created in the application, such as the API Gateway route, which removes the need to pass resource ARNs or IDs to the Lambda.
The full Slackbot application is covered on the Pulumi blog and includes examples for setting up additional AWS resources such as DynamoDB and SNS. The example also illustrates how when resources change (for example, switching from DynamoDB to RDS) Pulumi will ensure existing resources, such as the Lambda function, are updated with the appropriate access. Additionally, the Slackbot includes how to monitor resources with CloudWatch and create dashboards for observability.
Pulumi plans to extend the Crosswalk approach to additional cloud providers. Pulumi Crosswalk for AWS is currently supported in JavaScript and TypeScript with support for other languages, such as Python, on the roadmap. Crosswalk is open source and free to use, along with the Community Edition of Pulumi. Pulumi’s commercial offerings includes support Pulumi Crosswalk for AWS.