Want to learn about running containers in Lambda? Join our free hands-on workshop. Register Now

Fastly

The Fastly provider for Pulumi can be used to provision any of the cloud resources available in Fastly. The Fastly provider must be configured with credentials to deploy and update resources in Fastly.

See the full API documentation for complete details of the available Fastly provider APIs.

Setup

The Fastly provider supports several options for providing access to Fastly credentials. See the Fastly setup page for details.

Example

const fastly = require("@pulumi/fastly")

const service = new fastly.Servicev1("my-service", {
  backends: [{
       address: "127.0.0.1",
       name: "localhost",
       port: 80
   }],
  domains: [{
       comment: "demo",
       name: "demo.pulumi.com",
  }],
  forceDestroy: true,
});
import * as fastly from "@pulumi/fastly";

const service = new fastly.Servicev1("my-service", {
  backends: [{
       address: "127.0.0.1",
       name: "localhost",
       port: 80
   }],
  domains: [{
       comment: "demo",
       name: "demo.pulumi.com",
  }],
  forceDestroy: true,
});
import pulumi_fastly as fastly

service = fastly.Servicev1("my-service",
  backends=[{
    "address": "127.0.0.1",
    "name": "localhost",
    "port": "80",
  }],
  domains=[{
    "comment": "demo",
    "name": "demo.pulumi.com",
  }],
  force_destroy="true",
)
import (
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
    fastly "github.com/pulumi/pulumi-fastly/sdk/v2/go/fastly"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        service, err := fastly.NewServicev1(ctx, "test", &fastly.Servicev1Args{
            Backends: []fastly.Servicev1Backend{
                {
                    Address: pulumi.String("127.0.0.1"),
                    Name:    pulumi.String("localhost"),
                    Port:    pulumi.Int(80),
                },
            },
            Domains: []fastly.Servicev1Domain{
                {
                    Comment: pulumi.String("demo"),
                    Name:    pulumi.String("demo.pulumi.com"),
                },
            },
            ForceDestroy: pulumi.Bool(true),
        })
        if err != nil {
            return err
        }

        return nil
    })
}
using System.Collections.Generic;
using System.Threading.Tasks;
using Pulumi;
using Pulumi.Fastly;

class Program
{
    static Task Main() =>
        Deployment.Run(() => {
            var service = new Servicev1("test", new Servicev1Args
            {
                Backends = new Servicev1BackendsArgs{
                    {
                        Address="127.0.0.1",
                        Name="localhost",
                        Port=80
                    },
                },
                Domains = new Servicev1DomainsArgs{
                    {
                        Comment = "demo",
                        Name = "demo.pulumi.com"
                    },
                },
                ForceDestroy = true,
            });
        });
}

Libraries

The following packages are available in packager managers:

The Fastly provider is open source and available in the pulumi/pulumi-fastly repo.