53 lines
1.3 KiB
HCL
53 lines
1.3 KiB
HCL
resource "aws_s3_bucket" "raw_bucket" {
|
|
bucket = "datalake-raw-${var.account_number}-${var.student_initials}-${var.student_index_no}"
|
|
force_destroy = true
|
|
|
|
tags = {
|
|
Purpose = "UAM Cloud Data Processing"
|
|
Environment = "DEV"
|
|
}
|
|
}
|
|
|
|
resource "aws_s3_bucket" "processed_bucket" {
|
|
bucket = "datalake-processed-${var.account_number}-${var.student_initials}-${var.student_index_no}"
|
|
force_destroy = true
|
|
|
|
tags = {
|
|
Purpose = "UAM Cloud Data Processing"
|
|
Environment = "DEV"
|
|
}
|
|
}
|
|
|
|
resource "aws_s3_bucket" "athena_results" {
|
|
bucket ="athena-results-${var.account_number}-${var.student_initials}-${var.student_index_no}"
|
|
|
|
force_destroy = true
|
|
|
|
tags = merge(local.common_tags, )
|
|
}
|
|
|
|
resource "aws_s3_bucket_lifecycle_configuration" "athena_results_lifecycle" {
|
|
bucket = aws_s3_bucket.athena_results.id
|
|
|
|
rule {
|
|
id = "standard-expiration"
|
|
status = "Enabled"
|
|
expiration {
|
|
days=1
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
resource "aws_athena_workgroup" "athena_workgroup" {
|
|
name = "development"
|
|
|
|
configuration {
|
|
enforce_workgroup_configuration = true
|
|
result_configuration {
|
|
output_location = "s3://${aws_s3_bucket.athena_results.bucket}/output/"
|
|
}
|
|
}
|
|
|
|
force_destroy = true
|
|
} |