przetwarzanie_danych_w_chmu.../labs/terraform/s3.tf

53 lines
1.3 KiB
Terraform
Raw Normal View History

2024-05-12 11:05:35 +02:00
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
}