back
terraform {
required_providers {
oci = ">= 4.21.0"
}
}
top
module "oci_database_backups" {
source = "./modules/oci/d/oci_database_backups"
# compartment_id - (optional) is a type of string
compartment_id = null
# database_id - (optional) is a type of string
database_id = null
filter = [{
name = null
regex = null
values = []
}]
}
top
variable "compartment_id" {
description = "(optional)"
type = string
default = null
}
variable "database_id" {
description = "(optional)"
type = string
default = null
}
variable "filter" {
description = "nested block: NestingSet, min items: 0, max items: 0"
type = set(object(
{
name = string
regex = bool
values = list(string)
}
))
default = []
}
top
data "oci_database_backups" "this" {
# compartment_id - (optional) is a type of string
compartment_id = var.compartment_id
# database_id - (optional) is a type of string
database_id = var.database_id
dynamic "filter" {
for_each = var.filter
content {
# name - (required) is a type of string
name = filter.value["name"]
# regex - (optional) is a type of bool
regex = filter.value["regex"]
# values - (required) is a type of list of string
values = filter.value["values"]
}
}
}
top
output "backups" {
description = "returns a list of object"
value = data.oci_database_backups.this.backups
}
output "id" {
description = "returns a string"
value = data.oci_database_backups.this.id
}
output "this" {
value = oci_database_backups.this
}
top