File tree Expand file tree Collapse file tree 4 files changed +20
-4
lines changed Expand file tree Collapse file tree 4 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -220,11 +220,11 @@ resource "fastly_service_vcl" "cache" {
220
220
name = " Authenticate S3 requests"
221
221
type = " miss"
222
222
priority = 100
223
- content = templatefile (" ${ path . module } /cache/ s3-authn.vcl" , {
223
+ content = templatefile (" ${ path . module } /s3-authn.vcl" , {
224
224
aws_region = aws_s3_bucket.cache.region
225
225
backend_domain = aws_s3_bucket.cache.bucket_domain_name
226
- access_key = local.cache - iam.key
227
- secret_key = local.cache - iam.secret
226
+ access_key = local.fastly - iam.key
227
+ secret_key = local.fastly - iam.secret
228
228
})
229
229
}
230
230
Original file line number Diff line number Diff line change 4
4
# TLS v1.2, protocols HTTP/1.1 and HTTP/2
5
5
fastly_tls12_sni_configuration_id = " 5PXBTa6c01Xoh54ylNwmVA"
6
6
7
- cache-iam = data. terraform_remote_state . terraform-iam . outputs . cache
7
+ # Used for authenticating fastly against S3 buckets
8
+ fastly-iam = data. terraform_remote_state . terraform-iam . outputs . cache
9
+
8
10
fastlylogs = data. terraform_remote_state . terraform-iam . outputs . fastlylogs
9
11
10
12
# fastlylogs = {
Original file line number Diff line number Diff line change @@ -181,6 +181,20 @@ resource "fastly_service_vcl" "releases" {
181
181
status = 404
182
182
}
183
183
184
+ # Authenticate Fastly<->S3 requests. See Fastly documentation:
185
+ # https://docs.fastly.com/en/guides/amazon-s3#using-an-amazon-s3-private-bucket
186
+ snippet {
187
+ name = " Authenticate S3 requests"
188
+ type = " miss"
189
+ priority = 100
190
+ content = templatefile (" ${ path . module } /s3-authn.vcl" , {
191
+ aws_region = aws_s3_bucket.releases.region
192
+ backend_domain = aws_s3_bucket.releases.bucket_domain_name
193
+ access_key = local.fastly- iam.key
194
+ secret_key = local.fastly- iam.secret
195
+ })
196
+ }
197
+
184
198
snippet {
185
199
content = " set req.url = querystring.remove(req.url);"
186
200
name = " Remove all query strings"
File renamed without changes.
You can’t perform that action at this time.
0 commit comments