Skip to content
forked from pulumi/examples

A collection of Pulumi examples, across many clouds, and many languages

License

Notifications You must be signed in to change notification settings

leowmjw/examples

 
 

Repository files navigation

Pulumi Examples

This repository contains examples of using Pulumi to build and deploy cloud applications and infrastructure.

Each example has a two-part prefix, <cloud>-<language>, to indicate which <cloud> and <language> it pertains to. The cloud is one of aws for Amazon Web Services, azure for Microsoft Azure, gcp for Google Cloud Platform, kubernetes for Kubernetes, or cloud for Pulumi's cross-cloud programming framework.

See the Pulumi documentation for more details on getting started with Pulumi.

Cloud Infrastructure

Web Server

This is one of our most basic examples, showing how to provision a simple Linux webserver serving traffic on port 80. This example is available in multiple flavors:

An extension of this example demonstrates creating a minimal component that encapsulates creating EC2 instances, highlighting one of the benefits of using general purpose languages for managing infrastructure.

This example deploys a static website to AWS S3, demonstrating how to combine infrastructure code and content in the same application.

An extension of this sample shows how to create your own component for reusable infrastructure.

Cloud Applications

This example shows how to build a simple REST API to count the number of times a route has been hit. It shows how easy it is to create a simple application that uses AWS Lambda, API Gateway, and Dynamo DB.

This example shows how easy it is to build a simple container and deploy to AWS Fargate. With just 15 lines of code, you can deploy a container to a production service. Pulumi automatically builds the Docker container, provisions a container registry instance, and pushes the built image to it.

This example demonstrates a complete URL shortener web application using high-level cloud.Table and cloud.HttpEndpoint components, highlighting the ability to combine deployment time and runtime code, and the simple, cloud-agnostic, programming model of @pulumi/cloud. Although we only support AWS today in this framework, our plan is to offer an implementation of this on all major clouds, and so any code targeting this can truly run anywhere.

An extension of this example adds a reusable cache component to the URL shortener using cloud.Service to run a containerized Redis image. This shows that you can create your own cloud.*-like abstractions for your own use, your team's, or to share with the community using your language's package manager.

This example features an end-to-end pipeline for generating keyframe thumbnails from videos uploaded to a bucket using containerized FFmpeg. It combines containers, serverless functions, and cloud storage into a single 40-line application using @pulumi/cloud-aws.

An extension of this sample uses AWS Rekognition to find the timestamp with the highest confidence for a particular label.

This example deploys a complete serverless C# application using raw aws.apigateway.RestAPI, aws.lambda.Function and aws.dynamodb.Table resources from @pulumi/aws. Although this doesn't feature any of the higher-level abstractions from the @pulumi/cloud package, it demonstrates that you can program the raw resources directly available in AWS to accomplish all of the same things this higher-level package offers.

The deployed Lambda function is a simple C# application, highlighting the ability to manage existing application code in a Pulumi application, even if your Pulumi code is written in a different language like JavaScript or Python.

This examples shows a version of the Kubernetes Guestbook app using Pulumi and @pulumi/kubernetes.

A simple voting app that uses Redis for a data store and a Python Flask app for the frontend, demonstrating the high-level framework @pulumi/cloud.

A sample project that periodically queries Twitter for a search term, stores the results in S3, and configures an Athena query for data analysis.

About

A collection of Pulumi examples, across many clouds, and many languages

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • TypeScript 63.6%
  • JavaScript 17.8%
  • Python 6.0%
  • HTML 5.8%
  • C# 2.2%
  • Go 1.7%
  • Other 2.9%