Skip to content

Commit

Permalink
feat: terraform python.org fastly configuration (#2519)
Browse files Browse the repository at this point in the history
* feat: codify the infra

* feat: working tf plana

* chore(docs): fix garbage

* feat: latest most minimal diff :D

* Update infra/cdn/README.md

* run tf
  • Loading branch information
JacobCoffee authored Sep 5, 2024
1 parent 5cc25a0 commit aa4a966
Show file tree
Hide file tree
Showing 12 changed files with 565 additions and 0 deletions.
15 changes: 15 additions & 0 deletions infra/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

**/.terraform/*
*.tfstate
*.tfstate.*
crash.log
crash.*.log
*.tfvars
*.tfvars.json
override.tf
override.tf.json
*_override.tf
*_override.tf.json
.terraform.tfstate.lock.info
.terraformrc
terraform.rc
24 changes: 24 additions & 0 deletions infra/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions infra/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.PHONY: fmt
fmt:
@terraform fmt ./**/*.tf

.PHONY: check
check:
@terraform validate
33 changes: 33 additions & 0 deletions infra/cdn/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Fastly CDN Config

This module creates Fastly services for the Python.org staging and production instances.

## Usage

```hcl
module "fastly_production" {
source = "./cdn"
name = "CoolPythonApp.org"
domain = "CoolPythonApp.org"
subdomain = "www.CoolPythonApp.org"
extra_domains = ["www.CoolPythonApp.org"]
backend_address = "service.CoolPythonApp.org"
default_ttl = 3600
datadog_key = var.DATADOG_API_KEY
fastly_key = var.FASTLY_API_KEY
fastly_header_token = var.FASTLY_HEADER_TOKEN
s3_logging_keys = var.fastly_s3_logging
}
```

## Outputs

N/A

## Requirements

Tested on
- Tested on Terraform 1.8.5
- Fastly provider 5.13.0
25 changes: 25 additions & 0 deletions infra/cdn/certs/psf.io.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-----BEGIN CERTIFICATE-----
MIIEQzCCAyugAwIBAgIUYH38nEb2K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