Skip to main content

AWS F# Lambda web server

This example lives in the pulumi/examples repository. Check out just this directory to use it:

Get started with this example
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examples
git -C pulumi-examples sparse-checkout set aws-fs-lambda-webserver
cd pulumi-examples/aws-fs-lambda-webserver

This example creates a web server in AWS Lambda using the Giraffe web server.

Prerequisites#

  1. Install Pulumi
  2. Configure AWS credentials
  3. Install .NET

Deploying the example#

  1. Create a new stack:

    Terminal window
    pulumi -C ./pulumi stack init dev
  2. Set the AWS region to deploy into:

    Terminal window
    pulumi -C ./pulumi config set aws:region us-west-2
  3. Build and publish the Lambda function, making the output available to the Pulumi program:

    Terminal window
    dotnet publish ./LambdaWebServer
  4. Deploy the stack, which archives the published function output and creates the Lambda:

    Terminal window
    pulumi up -C ./pulumi
  5. In a browser, navigate to the URL for websiteUrl. You should see the welcome message.

Cleaning up#

Once you’re finished experimenting, tear down your stack’s resources by destroying and removing it:

Terminal window
pulumi destroy -C ./pulumi
pulumi stack rm -C ./pulumi

Related

The infrastructure as code platform for any cloud.