forked from JeffGiroux/f5_terraform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
37 lines (32 loc) · 835 Bytes
/
main.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
35
36
37
# Main
# AWS Provider
provider "aws" {
region = var.awsRegion
}
# Create a random id
resource "random_id" "buildSuffix" {
byte_length = 2
}
# Create the Storage Account
resource "aws_s3_bucket" "main" {
bucket = format("%sstorage%s", var.projectPrefix, random_id.buildSuffix.hex)
force_destroy = true
tags = {
Name = format("%sstorage%s", var.projectPrefix, random_id.buildSuffix.hex)
Owner = var.resourceOwner
f5_cloud_failover_label = var.f5_cloud_failover_label
}
}
# Bucket Encryption
resource "aws_s3_bucket_server_side_encryption_configuration" "main" {
bucket = aws_s3_bucket.main.bucket
rule {
apply_server_side_encryption_by_default {
sse_algorithm = "AES256"
}
}
}
# Retrieve AWS VPC info
data "aws_vpc" "main" {
id = var.vpcId
}