Skip to content

This workshop will walk you through the basics of using the Automation API of Pulumi to create and deploy a Pulumi stack programmatically with F#

Notifications You must be signed in to change notification settings

Zaid-Ajaj/pulumi-workshop-automation-fsharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pulumi Automation API workshop using F#

This workshop will walk you through the basics of using the Automation API of Pulumi to create and deploy a Pulumi stack programmatically.

This project implements a simple web API in F# using Falco with two endpoints:

  • POST /onboard which creates a stack for a customer and deploys an S3 bucket as a website
  • POST /offboard which destroys the stack for a customer

Prerequisites

Running the project

  1. Clone this repository
  2. Run dotnet run in the root of the project

You will need to have a Pulumi account and have logged in to the Pulumi CLI before running the project.

You can create an access token from the Pulumi service and once created, you can run the project with that token by setting the PULUMI_ACCESS_TOKEN environment variable:

PULUMI_ACCESS_TOKEN=<your-token> dotnet run

Using the API

Send a POST request to http://localhost:5000/onboard with the following JSON body:

{
    "tenant": "Zaid",
    "license": "MIT"
}

Which will create a stack with name "Zaid" under a project "tenant-infra" and deploy an S3 bucket as a website.

Using the same request body, you can destroy the stack by sending a POST request to http://localhost:5000/offboard.

About

This workshop will walk you through the basics of using the Automation API of Pulumi to create and deploy a Pulumi stack programmatically with F#

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages