File tree 7 files changed +40
-11
lines changed
legacy/crates-io-staging/crates-io
7 files changed +40
-11
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"aws" : {
3
3
"profile" : " crates-io-staging" ,
4
- "region" : " us-east-2 "
4
+ "region" : " us-west-1 "
5
5
}
6
6
}
Original file line number Diff line number Diff line change @@ -27,4 +27,6 @@ inputs = {
27
27
static_fastly_weight = 100
28
28
29
29
fastly_customer_id_ssm_parameter = " /staging/crates-io/fastly/customer-id"
30
+
31
+ cdn_log_event_queue_arn = " arn:aws:sqs:us-west-1:359172468976:cdn-log-event-queue"
30
32
}
Original file line number Diff line number Diff line change @@ -8,13 +8,3 @@ terraform {
8
8
}
9
9
}
10
10
}
11
-
12
- variable "bucket_account" {
13
- type = number
14
- description = " Account ID of the S3 bucket which will send events to the SQS queue"
15
- }
16
-
17
- variable "bucket_arn" {
18
- type = string
19
- description = " ARN of the S3 bucket which will send events to the SQS queue"
20
- }
Original file line number Diff line number Diff line change
1
+ # ARN of the SQS queue that receives S3 bucket notifications
2
+ output "sqs_queue_arn" {
3
+ value = aws_sqs_queue. cdn_log_event_queue . arn
4
+ }
Original file line number Diff line number Diff line change
1
+ variable "bucket_account" {
2
+ type = number
3
+ description = " Account ID of the S3 bucket which will send events to the SQS queue"
4
+ }
5
+
6
+ variable "bucket_arn" {
7
+ type = string
8
+ description = " ARN of the S3 bucket which will send events to the SQS queue"
9
+ }
Original file line number Diff line number Diff line change @@ -102,3 +102,9 @@ variable "fastly_aws_account_id" {
102
102
description = " The AWS account ID that Fastly uses to write logs"
103
103
default = " 717331877981"
104
104
}
105
+
106
+ variable "cdn_log_event_queue_arn" {
107
+ # See the `crates-io-logs` module
108
+ description = " ARN of the SQS queue that receives S3 notifications for CDN logs"
109
+ type = string
110
+ }
Original file line number Diff line number Diff line change @@ -25,3 +25,21 @@ resource "aws_s3_bucket_public_access_block" "logs" {
25
25
ignore_public_acls = true
26
26
restrict_public_buckets = true
27
27
}
28
+
29
+ resource "aws_s3_bucket_notification" "cdn_log_event_queue" {
30
+ bucket = aws_s3_bucket. logs . id
31
+
32
+ queue {
33
+ id = " cloudfront"
34
+ events = [" s3:ObjectCreated:*" ]
35
+ queue_arn = var. cdn_log_event_queue_arn
36
+ filter_prefix = " cloudfront/"
37
+ }
38
+
39
+ queue {
40
+ id = " fastly"
41
+ events = [" s3:ObjectCreated:*" ]
42
+ queue_arn = var. cdn_log_event_queue_arn
43
+ filter_prefix = " fastly-requests/"
44
+ }
45
+ }
You can’t perform that action at this time.
0 commit comments