back
terraform {
required_providers {
oci = ">= 4.21.0"
}
}
top
module "oci_core_volumes" {
source = "./modules/oci/d/oci_core_volumes"
# availability_domain - (optional) is a type of string
availability_domain = null
# compartment_id - (required) is a type of string
compartment_id = null
# display_name - (optional) is a type of string
display_name = null
# state - (optional) is a type of string
state = null
# volume_group_id - (optional) is a type of string
volume_group_id = null
filter = [{
name = null
regex = null
values = []
}]
}
top
variable "availability_domain" {
description = "(optional)"
type = string
default = null
}
variable "compartment_id" {
description = "(required)"
type = string
}
variable "display_name" {
description = "(optional)"
type = string
default = null
}
variable "state" {
description = "(optional)"
type = string
default = null
}
variable "volume_group_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_core_volumes" "this" {
# availability_domain - (optional) is a type of string
availability_domain = var.availability_domain
# compartment_id - (required) is a type of string
compartment_id = var.compartment_id
# display_name - (optional) is a type of string
display_name = var.display_name
# state - (optional) is a type of string
state = var.state
# volume_group_id - (optional) is a type of string
volume_group_id = var.volume_group_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 "id" {
description = "returns a string"
value = data.oci_core_volumes.this.id
}
output "volumes" {
description = "returns a list of object"
value = data.oci_core_volumes.this.volumes
}
output "this" {
value = oci_core_volumes.this
}
top