This repository has been archived by the owner on Jun 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.tf
75 lines (62 loc) · 1.76 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
## Managed By : CloudDrove
##Description : This Script is used to create VPC.
## Copyright @ CloudDrove. All Right Reserved.
# locals for regions
locals {
region = {
amsterdam-2 = "ams2"
amsterdam-3 = "ams3"
bangalore-1 = "blr1"
frankfurt-1 = "fra1"
london-1 = "lon-1"
newyork-1 = "nyc1"
newyork-2 = "nyc2"
newyork-3 = "nyc3"
francisco-1 = "sfo1"
singapore-1 = "sgp1"
toronto-1 = "tor1"
}
}
#Module : LABEL
#Description : Terraform label module variables.
module "labels" {
source = "terraform-do-modules/labels/digitalocean"
version = "0.15.0"
name = var.name
environment = var.environment
label_order = var.label_order
attributes = var.attributes
}
#Module : Spaces
#Description : Provides a bucket resource for Spaces, DigitalOcean's object storage product.
resource "digitalocean_spaces_bucket" "spaces" {
name = module.labels.id
region = var.region
acl = var.acl
force_destroy = var.force_destroy
dynamic "cors_rule" {
for_each = var.cors_rule == null ? [] : var.cors_rule
content {
allowed_headers = cors_rule.value.allowed_headers
allowed_methods = cors_rule.value.allowed_methods
allowed_origins = cors_rule.value.allowed_origins
max_age_seconds = cors_rule.value.max_age_seconds
}
}
lifecycle_rule {
enabled = false
prefix = var.prefix
abort_incomplete_multipart_upload_days = var.abort_incomplete_multipart_upload_days
expiration {
date = var.date
days = var.expiration_days
expired_object_delete_marker = var.expired_object_delete_marker
}
noncurrent_version_expiration {
days = var.noncurrent_version_expiration
}
}
versioning {
enabled = var.versioning
}
}