-
Notifications
You must be signed in to change notification settings - Fork 3
/
data.tf
34 lines (26 loc) · 874 Bytes
/
data.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Required for cloudfront access logs bucket
data "aws_canonical_user_id" "current" {}
data "aws_cloudfront_log_delivery_canonical_user_id" "awslogsdelivery" {}
data "aws_caller_identity" "current" {}
data "aws_iam_policy_document" "lambda_dynamodb_access" {
statement {
sid = "AllowAccessToDynamoDB"
actions = ["dynamodb:Scan"]
resources = [aws_dynamodb_table.users.arn]
}
}
data "aws_iam_policy_document" "origin_bucket_policy" {
statement {
sid = "AllowCloudFrontAccessToBucket"
effect = "Allow"
actions = ["s3:GetObject"]
principals {
identifiers = [aws_cloudfront_origin_access_identity.origin_access_identity.iam_arn]
type = "AWS"
}
resources = ["${aws_s3_bucket.origin_website.arn}/*"]
}
}
data "aws_cloudfront_cache_policy" "cache_optimized" {
name = "Managed-CachingOptimized"
}