Fastly¶
Imported from Confluence
Content may be outdated. Verify before following any procedures. View original | Last updated: November 2024
You should be able to see Fastly application in the OKTA page, in case if it's missing please create ticket for CIT.
Fastly documentation - Documentation
Gitlab repo - appgrowthplatform (Gitlab)
Configuration¶
- Issue certificate for your domain in Security → TLS Management → Domains
- Specify Origin which is basically your asset backend (S3, GCS, etc)

- In order to override Header, Response, etc use Content/Headers sections

- For Condition statement use VCS, which supports Snippet creation.

- Point your CDN DNS to SSL Fastly endpoint according to this - Working With Cname Records And Your Dns Provider
Terraform¶
Structure is same for all projects. We use terraform mostly as a backup tool for all CDN configurations. We found it's way easier to configure CDN via UI and import to terraform.

It consists of needed providers, backend bucket and secret with api key to interact with Fastly.
#### Create import.tf resourse
import {
to = fastly_service_vcl.scale-assets-staging-fyber-com
id = "fastly_cdn_id"
}
#### Genarate terraform code for remote resources
terraform plan -generate-config-out=generated1.tf
#### Import fastly resource with specific id to terraform state
terraform import fastly_service_vcl.scale-assets-staging-fyber-com <fastly_cdn_id>