Skip to content

Commit 15a544e

Browse files
committed
feat: add logging configs (partial)
1 parent 2afd560 commit 15a544e

File tree

6 files changed

+55
-59
lines changed

6 files changed

+55
-59
lines changed

infra/.terraform.lock.hcl

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

infra/cdn.tf

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ resource "fastly_service_vcl" "cdn" {
88
default_ttl = 3600
99
force_refresh = false
1010
http3 = false
11-
id = "1d1Bii4LcJ9joSaowpIdb3"
11+
id = "z5nOzklFYCXDAUiLeqvS25"
1212
imported = false
1313
name = "test.python.org"
1414
stale_if_error = false
@@ -277,19 +277,36 @@ resource "fastly_service_vcl" "cdn" {
277277
window = 5
278278
}
279279

280-
logging_datadog { # TODO
281-
# At least one attribute in this block is (or was) sensitive,
282-
# so its contents will not be displayed.
280+
logging_datadog {
281+
name = "ratelimit-debug"
282+
token = var.DATADOG_API_KEY
283+
region = "US"
283284
}
284285

285-
logging_s3 { # TODO
286-
# At least one attribute in this block is (or was) sensitive,
287-
# so its contents will not be displayed.
286+
logging_s3 {
287+
name = "psf-fastly-logs"
288+
bucket_name = "psf-fastly-logs-eu-west-1"
289+
domain = "s3-eu-west-1.amazonaws.com"
290+
path = "/www-python-org/%Y/%m/%d/"
291+
period = 3600
292+
gzip_level = 9
293+
# %h "%{now}V" %l "%{req.request}V %{req.url}V" %{req.proto}V %>s %{resp.http.Content-Length}V %{resp.http.age}V "%{resp.http.x-cache}V" "%{resp.http.x-cache-hits}V" "%{req.http.content-type}V" "%{req.http.accept-language}V" "%{cstr_escape(req.http.user-agent)}V"
294+
format = "" # TODO
295+
timestamp_format = "%Y-%m-%dT%H:%M:%S.000"
296+
redundancy = "standard"
297+
format_version = 2
298+
message_type = "classic"
299+
compression_codec = "gzip"
300+
access_key = var.AWS_ACCESS_KEY_ID
301+
secret_key = var.AWS_SECRET_ACCESS_KEY
288302
}
289303

290-
logging_syslog { # TODO
291-
# At least one attribute in this block is (or was) sensitive,
292-
# so its contents will not be displayed.
304+
logging_syslog {
305+
name = "syslog"
306+
address = "cdn-logs.nyc1.psf.io"
307+
port = 514
308+
# %h "%{now}V" %l "%{req.request}V %{req.url}V" %{req.proto}V %>s %{resp.http.Content-Length}V %{resp.http.age}V "%{resp.http.x-cache}V" "%{resp.http.x-cache-hits}V" "%{req.http.content-type}V" "%{req.http.accept-language}V" "%{cstr_escape(req.http.user-agent)}V"
309+
format = "" # TODO
293310
}
294311

295312
product_enablement {
@@ -310,7 +327,7 @@ resource "fastly_service_vcl" "cdn" {
310327
logger_type = "datadog"
311328
name = "test.python.org backends"
312329
penalty_box_duration = 2
313-
ratelimiter_id = "6SnVeRHflsd9pTPPFvhYqX"
330+
ratelimiter_id = "..." # TODO: create one for ngwaf test service
314331
response_object_name = null
315332
rps_limit = 10
316333
uri_dictionary_name = null

infra/import/.terraform.lock.hcl

Lines changed: 0 additions & 24 deletions
This file was deleted.

infra/import/README.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

infra/import/providers.tf

Whitespace-only changes.

infra/variables.tf

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ variable "FASTLY_HEADER_TOKEN" {
1313
variable "USER_VCL_SERVICE_DOMAIN_NAME" {
1414
type = string
1515
description = "Frontend domain for your service."
16-
default = "ngwaftest.psf.io"
16+
default = "test.python.org"
1717
}
1818

1919
variable "USER_VCL_SERVICE_BACKEND_HOSTNAME" {
2020
type = string
2121
description = "Hostname used for backend."
22-
default = "test-ngwaf.psf.io"
22+
default = "test.python.org"
2323
}
2424

2525
variable "Edge_Security_dictionary" {
@@ -74,11 +74,18 @@ variable "route53_zone_id" {
7474
variable "route53_record_name" {
7575
type = string
7676
description = "The name of the CNAME record"
77-
default = "ngwaftest.psf.io"
77+
default = "test.python.org"
7878
}
7979

8080
variable "route53_record_ttl" {
8181
type = number
8282
description = "The TTL for the CNAME record"
8383
default = 60
84+
}
85+
86+
# dd
87+
variable "DATADOG_API_KEY" {
88+
type = string
89+
description = "API key for Datadog"
90+
sensitive = true
8491
}

0 commit comments

Comments
 (0)