-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbucket.tf
More file actions
53 lines (42 loc) · 1.27 KB
/
Copy pathbucket.tf
File metadata and controls
53 lines (42 loc) · 1.27 KB
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
resource "oci_objectstorage_bucket" "self" {
name = "${local.unique_resource_name}-backups"
compartment_id = oci_identity_compartment.self.id
namespace = data.oci_objectstorage_namespace.self.namespace
storage_tier = "Standard"
freeform_tags = {
project = var.project_name
}
depends_on = [
data.oci_objectstorage_namespace.self
]
}
resource "oci_objectstorage_object_lifecycle_policy" "self" {
bucket = oci_objectstorage_bucket.self.name
namespace = data.oci_objectstorage_namespace.self.namespace
rules {
action = "DELETE"
is_enabled = true
name = "delete_older_backups"
target = "objects"
time_amount = "30"
time_unit = "DAYS"
object_name_filter {
inclusion_patterns = [
"*.zip",
]
exclusion_patterns = [
"config/*",
"mods/*"
]
}
}
depends_on = [
data.oci_objectstorage_namespace.self
]
}
resource "oci_objectstorage_object" "bootstrap_config" {
bucket = oci_objectstorage_bucket.self.name
namespace = data.oci_objectstorage_namespace.self.namespace
content = filebase64(data.archive_file.bootstrap_config.output_path)
object = local.bootstrap_config_zip_prefix
}