Skip to content

Latest commit

 

History

History
176 lines (144 loc) · 3.44 KB

oci_monitoring_metric_data.md

File metadata and controls

176 lines (144 loc) · 3.44 KB

oci_monitoring_metric_data

back

Index

Terraform

terraform {
  required_providers {
    oci = ">= 4.21.0"
  }
}

top

Example Usage

module "oci_monitoring_metric_data" {
  source = "./modules/oci/d/oci_monitoring_metric_data"

  # compartment_id - (required) is a type of string
  compartment_id = null
  # compartment_id_in_subtree - (optional) is a type of bool
  compartment_id_in_subtree = null
  # end_time - (optional) is a type of string
  end_time = null
  # namespace - (required) is a type of string
  namespace = null
  # query - (required) is a type of string
  query = null
  # resolution - (optional) is a type of string
  resolution = null
  # resource_group - (optional) is a type of string
  resource_group = null
  # start_time - (optional) is a type of string
  start_time = null

  filter = [{
    name   = null
    regex  = null
    values = []
  }]
}

top

Variables

variable "compartment_id" {
  description = "(required)"
  type        = string
}

variable "compartment_id_in_subtree" {
  description = "(optional)"
  type        = bool
  default     = null
}

variable "end_time" {
  description = "(optional)"
  type        = string
  default     = null
}

variable "namespace" {
  description = "(required)"
  type        = string
}

variable "query" {
  description = "(required)"
  type        = string
}

variable "resolution" {
  description = "(optional)"
  type        = string
  default     = null
}

variable "resource_group" {
  description = "(optional)"
  type        = string
  default     = null
}

variable "start_time" {
  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

Datasource

data "oci_monitoring_metric_data" "this" {
  # compartment_id - (required) is a type of string
  compartment_id = var.compartment_id
  # compartment_id_in_subtree - (optional) is a type of bool
  compartment_id_in_subtree = var.compartment_id_in_subtree
  # end_time - (optional) is a type of string
  end_time = var.end_time
  # namespace - (required) is a type of string
  namespace = var.namespace
  # query - (required) is a type of string
  query = var.query
  # resolution - (optional) is a type of string
  resolution = var.resolution
  # resource_group - (optional) is a type of string
  resource_group = var.resource_group
  # start_time - (optional) is a type of string
  start_time = var.start_time

  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

Outputs

output "id" {
  description = "returns a string"
  value       = data.oci_monitoring_metric_data.this.id
}

output "metric_data" {
  description = "returns a list of object"
  value       = data.oci_monitoring_metric_data.this.metric_data
}

output "this" {
  value = oci_monitoring_metric_data.this
}

top