Skip to content

Commit fd1874c

Browse files
author
Alexander Wiechert
committed
add athena setuo + queries
1 parent f09af6e commit fd1874c

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

cloudwatch_alarms.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ resource "aws_cloudwatch_composite_alarm" "ebs_composite_alarm" {
5656
alarm_rule = join(" OR ", compact([
5757
"ALARM(${aws_cloudwatch_metric_alarm.read_ops_low[each.key].alarm_name})",
5858
"ALARM(${aws_cloudwatch_metric_alarm.write_ops_low[each.key].alarm_name})",
59-
contains(keys(local.ssd_volumes), each.key) ? "ALARM(${aws_cloudwatch_metric_alarm.burst_balance_low[each.key].alarm_name})" : ""
59+
contains(keys(local.ssd_volumes), each.key) ? "ALARM(${aws_cloudwatch_metric_alarm.burst_balance_low[each.key].alarm_name})" : ""
6060
]))
6161

6262
alarm_description = "Composite alarm for EBS volume ${each.key}"

cost_usage.tf

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,31 @@ resource "aws_s3_bucket_policy" "cur_bucket_policy" {
2525
Principal = {
2626
Service = "billingreports.amazonaws.com"
2727
}
28-
Action = "s3:GetBucketAcl"
28+
Action = "s3:GetBucketAcl"
2929
Resource = aws_s3_bucket.cur_bucket.arn
30-
},
30+
},
3131
{
3232
Sid = "AWSBillingPutObject"
3333
Effect = "Allow"
3434
Principal = {
3535
Service = "billingreports.amazonaws.com"
3636
}
37-
Action = "s3:PutObject"
37+
Action = "s3:PutObject"
3838
Resource = "${aws_s3_bucket.cur_bucket.arn}/*"
39-
}]
39+
}]
4040
})
4141
}
4242

4343
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
4747
}
4848

4949
resource "aws_athena_data_catalog" "cur_catalog" {
50-
name = "AwsDataCatalog"
50+
name = "AwsDataCatalog"
5151
description = "Example Athena data catalog"
52-
type = "GLUE"
52+
type = "GLUE"
5353
parameters = {
5454
"catalog-id" = aws_glue_catalog_table.cur_table.id
5555
}
@@ -79,11 +79,11 @@ resource "aws_iam_role" "glue_crawler_role" {
7979
assume_role_policy = jsonencode({
8080
Version = "2012-10-17",
8181
Statement = [{
82-
Effect = "Allow",
82+
Effect = "Allow",
8383
Principal = {
8484
Service = "glue.amazonaws.com"
8585
},
86-
Action = "sts:AssumeRole"
86+
Action = "sts:AssumeRole"
8787
}]
8888
})
8989
}
@@ -95,8 +95,8 @@ resource "aws_iam_role_policy" "glue_crawler_policy" {
9595
Version = "2012-10-17",
9696
Statement = [
9797
{
98-
Effect = "Allow",
99-
Action = [
98+
Effect = "Allow",
99+
Action = [
100100
"s3:GetObject",
101101
"s3:PutObject",
102102
"s3:DeleteObject",
@@ -108,15 +108,15 @@ resource "aws_iam_role_policy" "glue_crawler_policy" {
108108
]
109109
},
110110
{
111-
Effect = "Allow",
112-
Action = [
111+
Effect = "Allow",
112+
Action = [
113113
"glue:*"
114114
],
115115
Resource = "*"
116116
},
117117
{
118-
Effect = "Allow",
119-
Action = [
118+
Effect = "Allow",
119+
Action = [
120120
"logs:CreateLogGroup",
121121
"logs:CreateLogStream",
122122
"logs:PutLogEvents"

0 commit comments

Comments
 (0)