@@ -25,31 +25,31 @@ resource "aws_s3_bucket_policy" "cur_bucket_policy" {
25
25
Principal = {
26
26
Service = " billingreports.amazonaws.com"
27
27
}
28
- Action = " s3:GetBucketAcl"
28
+ Action = " s3:GetBucketAcl"
29
29
Resource = aws_s3_bucket.cur_bucket.arn
30
- },
30
+ },
31
31
{
32
32
Sid = " AWSBillingPutObject"
33
33
Effect = " Allow"
34
34
Principal = {
35
35
Service = " billingreports.amazonaws.com"
36
36
}
37
- Action = " s3:PutObject"
37
+ Action = " s3:PutObject"
38
38
Resource = " ${ aws_s3_bucket . cur_bucket . arn } /*"
39
- }]
39
+ }]
40
40
})
41
41
}
42
42
43
43
resource "aws_athena_database" "cur_database" {
44
- name = " cur_database"
45
- comment = " Athena database for CUR analysis"
46
- bucket = aws_s3_bucket. cur_bucket . id
44
+ name = " cur_database"
45
+ comment = " Athena database for CUR analysis"
46
+ bucket = aws_s3_bucket. cur_bucket . id
47
47
}
48
48
49
49
resource "aws_athena_data_catalog" "cur_catalog" {
50
- name = " AwsDataCatalog"
50
+ name = " AwsDataCatalog"
51
51
description = " Example Athena data catalog"
52
- type = " GLUE"
52
+ type = " GLUE"
53
53
parameters = {
54
54
" catalog-id" = aws_glue_catalog_table.cur_table.id
55
55
}
@@ -79,11 +79,11 @@ resource "aws_iam_role" "glue_crawler_role" {
79
79
assume_role_policy = jsonencode ({
80
80
Version = " 2012-10-17" ,
81
81
Statement = [{
82
- Effect = " Allow" ,
82
+ Effect = " Allow" ,
83
83
Principal = {
84
84
Service = " glue.amazonaws.com"
85
85
},
86
- Action = " sts:AssumeRole"
86
+ Action = " sts:AssumeRole"
87
87
}]
88
88
})
89
89
}
@@ -95,8 +95,8 @@ resource "aws_iam_role_policy" "glue_crawler_policy" {
95
95
Version = " 2012-10-17" ,
96
96
Statement = [
97
97
{
98
- Effect = " Allow" ,
99
- Action = [
98
+ Effect = " Allow" ,
99
+ Action = [
100
100
" s3:GetObject" ,
101
101
" s3:PutObject" ,
102
102
" s3:DeleteObject" ,
@@ -108,15 +108,15 @@ resource "aws_iam_role_policy" "glue_crawler_policy" {
108
108
]
109
109
},
110
110
{
111
- Effect = " Allow" ,
112
- Action = [
111
+ Effect = " Allow" ,
112
+ Action = [
113
113
" glue:*"
114
114
],
115
115
Resource = " *"
116
116
},
117
117
{
118
- Effect = " Allow" ,
119
- Action = [
118
+ Effect = " Allow" ,
119
+ Action = [
120
120
" logs:CreateLogGroup" ,
121
121
" logs:CreateLogStream" ,
122
122
" logs:PutLogEvents"
0 commit comments