Skip to content

aws-ia/cloudformation-fastly-resource-providers

Repository files navigation

Fastly CloudFormation Resources Types

This collection of AWS CloudFormation resource types allow Fastly to be controlled using AWS CloudFormation.

The resources are created by the fastly npm package.

See the end-user documentation including:

Resource Description Documentation
Fastly::Services::Service This resource type manages a service for Fastly Service /Fastly-Services-Service
Fastly::Services::Backend This resource type manages a Fastly Backend /Fastly-Services-Backend
Fastly::Services::Domain This resource type manages a Fastly Domain /Fastly-Services-Domain
Fastly::Dictionary::Dictionary This resource type manages a Fastly Dictionary /Fastly-Dictionary-Dictionary
Fastly::Dictionary::DictionaryItem This resource type manages a Fastly Dictionary Item /Fastly-Dictionary-DictionaryItem
Fastly::Services::Healthcheck This resource type manages a Fastly Health Check /Fastly-Services-Healthcheck
Fastly::Logging::S3 This resource type manages a Fastly Logging for S3 /Fastly-Logging-S3
Fastly::Logging::Splunk This resource type manages a Fastly Logging for Splunk /Fastly-Logging-Splunk
Fastly::Tls::Certificate This resource type manages a custom Fastly Tls Certificate /Fastly-Tls-Certificate
Fastly::Tls::Domain This resource type manages a Fastly Tls Domain Activation /Fastly-Tls-Domain
Fastly::Tls::PrivateKeys This resource type manages a Fastly Tls Private Keys upload /Fastly-Tls-PrivateKeys

Prerequisites

AWS Management Console

To get started:

  1. Sign in to the AWS Management Console with your account and navigate to CloudFormation.

  2. Select "Public extensions" from the left hand pane and filter Publisher by "Third Party".

  3. Use the search bar to filter by the "Fastly" prefix.

Note: All official Fastly resources begin with Fastly:: and specify that they are Published by Fastly.

  1. Select the desired resource name to view more information about its schema, and click Activate.

  2. On the Extension details page, specify:

  • Extension name
  • Execution role ARN
  • Automatic updates for minor version releases
  • Configuration
  1. In your terminal, specify the configuration data for the registered Fastly CloudFormation resource type, in the given account and region by using the SetTypeConfiguration operation:

For example:

$ aws cloudformation set-type-configuration \
--region us-west-2 --type RESOURCE \
--type-name Fastly::Services::Backend \
--configuration-alias default \
--configuration "{ \"FastlyAccess\":{\"Token\":\"YOURTOKEN\"}}"
  1. After you have your resource configured, create your AWS stack that includes any of the activated Fastly resources.

For more information about available commands and workflows, see the official AWS documentation.

Supported regions

The Fastly CloudFormation resources are available on the CloudFormation Public Registry in the following regions:

Code Name
us-east-1 US East (N. Virginia)
us-east-2 US East (Ohio)
us-west-1 US West (N. California)
us-west-2 US West (Oregon)
ap-south-1 Asia Pacific (Mumbai)
ap-northeast-1 Asia Pacific (Tokyo)
ap-northeast-2 Asia Pacific (Seoul)
ap-southeast-1 Asia Pacific (Singapore)
ap-southeast-2 Asia Pacific (Sydney)
ca-central-1 Canada (Central)
eu-central-1 Europe (Frankfurt)
eu-west-1 Europe (Ireland)
eu-west-2 Europe (London)
eu-west-3 Europe (Paris)
eu-north-1 Europe (Stockholm)
sa-east-1 South America (São Paulo)

Note: To privately register a resource in any other region, use the provided packages.

Examples

Shows how to create a Deliver Service in Fastly

---
AWSTemplateFormatVersion: '2010-09-09'
Description: Shows how to create a Service in Fastly
Resources:
  MySampleProject:
    Type: Fastly::Services::Service
    Properties:
        Name: Example Service Name

Shows how to attach a Domain in Fastly.

---
AWSTemplateFormatVersion: '2010-09-09'
Description: Shows how to create a Domain in Fastly
Resources:
  MySampleProject:
    Type: Fastly::Services::Domain
    Properties:
        Name: example.co.uk,
        ServiceId: abc123xyz,
        VersionId: 2,
        Comment: This is a domain

Shows how to create a Health Check in Fastly

---
AWSTemplateFormatVersion: '2010-09-09'
Description: Shows how to create a Health Check in Fastly
Resources:
  MySampleProject:
    Type: Fastly::Services::Healthcheck
    Properties:
        ServiceId: abc123xyz,
        VersionId: 2,
        Name: Test healthcheck,
        CheckInterval: 60000,
        Host: aws.amazon.com,
        Initial: 1,
        Threshold: 1,
        Timeout: 5000,
        Window: 2

Shows how to create a Backend in Fastly

---
AWSTemplateFormatVersion: '2010-09-09'
Description: Shows how to create a Backend in Fastly
Resources:
  MySampleProject:
    Type: Fastly::Services::Backend
    Properties:
        ServiceId: abc1234xyz,
        VersionId: 2,
        Name: aws.amazon.com,
        Address: aws.amazon.com,
        Comment: Hello AWS,
        Port: 443,
        UseSsl: true,
        MinTlsVersion: 1.0,
        MaxTlsVersion: 1.3,
        Weight: 1,
        BetweenBytesTimeout: 4096,
        ConnectTimeout: 500,
        FirstByteTimeout: 50,
        MaxConn: 10

Shows how to create a Dictionary in Fastly

---
AWSTemplateFormatVersion: '2010-09-09'
Description: Shows how to create a Dictionary in Fastly
Resources:
  MySampleProject:
    Type: Fastly::Dictionary::Dictionary
    Properties:
      ServiceId: 3504143
      VersionId: 123
      Name: Dictionary Example Name

Shows how to create a Dictionary Item in Fastly

---
AWSTemplateFormatVersion: '2010-09-09'
Description: Shows how to create a Dictionary in Fastly
Resources:
  MySampleProject:
    Type: Fastly::Dictionary::DictionaryItem
    Properties:
      ServiceId: 3504143
      DictionaryId: 123
      ItemKey: Example Item Dictionary Key
      ItemValue: Value of Dictionary Key

Shows how to create a Logging S3 Endpoint in Fastly

---
AWSTemplateFormatVersion: '2010-09-09'
Description: Shows how to create a Logging S3 Endpoint in Fastly
Resources:
  MySampleProject:
    Type: Fastly::Logging::S3
    Properties:
      ServiceId: 3504143
      VersionId: 123
      Name: S3 Example Name
      AccessKey: MyAWSAccessKey
      SecretKey: MyAWSSecretKey
      BucketName: MyS3BucketName

Shows how to create a Logging Splunk Endpoint in Fastly

---
AWSTemplateFormatVersion: '2010-09-09'
Description: Shows how to create a Logging Splunk Endpoint in Fastly
Resources:
  MySampleProject:
    Type: Fastly::Logging::Splunk
    Properties:
      ServiceId: 3504143
      VersionId: 123
      Name: Splunk Example Name
      Token: MySplunkToken
      Url: "https://mysplunkhost:8088/services/collector/event/1.0"

Shows how to upload custom Tls Private Keys for Fastly

---
AWSTemplateFormatVersion: '2010-09-09'
Description: Shows how to activate a custom Tls Private Keys for Fastly
Resources:
  MySampleProject:
    Type: Fastly::Tls::PrivateKeys
    Properties:
        Type: tls_private_key,
        Attributes:
            Key: -----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\ns
            Name: example name

Shows how to upload a custom Tls Certificate to Fastly

---
AWSTemplateFormatVersion: '2010-09-09'
Description: Shows how to upload a custom Tls Certificate to Fastly
Resources:
  MySampleProject:
    Type: Fastly::Tls::Certificate
    Properties:
        Type: tls_certificate,
        Attributes: 
            CertBlob: -----BEGIN CERTIFICATE-----\n ... \n-----END CERTIFICATE-----,
            Name: Tls name

Shows how to activate a custom Tls Domain for Fastly

---
AWSTemplateFormatVersion: '2010-09-09'
Description: Shows how to activate a custom Tls Domain for Fastly
Resources:
  MySampleProject:
    Type: Fastly::Tls::Domain
    Properties:
        Type: tls_activation
        Relationships: 
            TlsCertificate: 
                Data: 
                    Id: tlsCertId123,
                    Type: tls_certificate
            TlsDomain: 
                Data:
                    Id: example.com,
                    Type: tls_domain
            TlsConfiguration: 
                Data:
                    Id: tlsConfigId123,
                    Type: tls_configuration

Releases

No releases published

Packages

No packages published