@@ -267,3 +267,261 @@ data "oci_logging_unified_agent_configurations" "test_unified_agent_configuratio
267267 log_id = var. test_log_id
268268 state = var. unified_agent_configuration_state
269269}
270+
271+ resource "oci_logging_unified_agent_configuration" "test_unified_agent_configuration_1" {
272+ # Required
273+ compartment_id = var. compartment_id
274+ is_enabled = var. unified_agent_configuration_is_enabled
275+ service_configuration {
276+ # Required
277+ configuration_type = " LOGGING"
278+
279+ # Required field destination for service_configuration
280+ destination {
281+ # Required field for destination
282+ log_object_id = var. test_log_id
283+ operational_metrics_configuration {
284+ destination {
285+ compartment_id = var. compartment_id
286+ }
287+ source {
288+ type = " UMA_METRICS"
289+ record_input {
290+ namespace = " tf_test_namespace"
291+ resource_group = " tf-test-resource-group"
292+ }
293+ }
294+ }
295+ }
296+ sources {
297+ # Required
298+ source_type = " LOG_TAIL"
299+ name = var. unified_agent_configuration_service_configuration_sources_name
300+ advanced_options {
301+ is_read_from_head = true
302+ }
303+ parser {
304+ parser_type = " JSON"
305+ field_time_key = " time"
306+ is_keep_time_key = true
307+ timeout_in_milliseconds = 1000
308+ }
309+ paths = [" /var/log/*" ]
310+ }
311+ sources {
312+ # Required
313+ source_type = " WINDOWS_EVENT_LOG"
314+ name = " windows_event_test"
315+ channels = [" system" ]
316+ }
317+ # could test custom_plugin sources here too
318+ unified_agent_configuration_filter {
319+ filter_type = " GREP_FILTER"
320+ allow_list {
321+ key = " key"
322+ pattern = " value"
323+ }
324+ deny_list {
325+ key = " key"
326+ pattern = " value"
327+ }
328+ name = " test"
329+ }
330+ }
331+
332+ # Optional
333+ defined_tags = {
334+ " ${var.tag_namespace1_name}.${var.tag1_name}" = var.log_group_defined_tags_value
335+ }
336+ description = var. unified_agent_configuration_description
337+ display_name = " test_unified_agent_configuration_1"
338+ freeform_tags = var. unified_agent_configuration_freeform_tags
339+ group_association {
340+ # Optional
341+ group_list = [" ocid1.dynamicgroup.oc1..aaaaaaaatqbpurg4jtr57dthka4lbykvsqajjmynecixwgsfgu2z36wf4kgq" ]
342+ }
343+
344+ lifecycle {
345+ ignore_changes = [ defined_tags ]
346+ }
347+ }
348+ data "oci_logging_unified_agent_configurations" "test_unified_agent_configurations_KUBERNETES" {
349+ # Required
350+ compartment_id = var. compartment_id
351+
352+ # Optional
353+ display_name = " test_unified_agent_configuration_1"
354+ group_id = var. test_log_group_id
355+ is_compartment_id_in_subtree = var. unified_agent_configuration_is_compartment_id_in_subtree
356+ log_id = var. test_log_id
357+ state = var. unified_agent_configuration_state
358+ }
359+
360+ resource "oci_logging_unified_agent_configuration" "test_unified_agent_configuration_monitoring_KUBERNETES" {
361+ # Required
362+ compartment_id = var. compartment_id
363+ is_enabled = var. unified_agent_configuration_is_enabled
364+ service_configuration {
365+ # Required
366+ configuration_type = " MONITORING"
367+
368+ application_configurations {
369+ destination {
370+ compartment_id = var. compartment_id
371+ metrics_namespace = " tf_test_namespace"
372+ }
373+ source_type = " KUBERNETES"
374+ source {
375+ name = " kubernetes_source"
376+ scrape_targets {
377+ k8s_namespace = " kube_system"
378+ resource_group = " tf-test-resource-group"
379+ resource_type = " PODS"
380+ service_name = " kubernetes"
381+ }
382+ }
383+ unified_agent_configuration_filter {
384+ filter_type = " KUBERNETES_FILTER"
385+ name = " kubernetes_filter"
386+ allow_list = [" allow_list" ]
387+ deny_list = [" deny_list" ]
388+ }
389+ }
390+ }
391+
392+ # Optional
393+ defined_tags = {
394+ " ${var.tag_namespace1_name}.${var.tag1_name}" = var.log_group_defined_tags_value
395+ }
396+ description = var. unified_agent_configuration_description
397+ display_name = " test_unified_agent_configuration_monitoring_KUBERNETES"
398+ freeform_tags = var. unified_agent_configuration_freeform_tags
399+ group_association {
400+ # Optional
401+ group_list = [" ocid1.dynamicgroup.oc1..aaaaaaaatqbpurg4jtr57dthka4lbykvsqajjmynecixwgsfgu2z36wf4kgq" ]
402+ }
403+
404+ lifecycle {
405+ ignore_changes = [ defined_tags ]
406+ }
407+ }
408+
409+ data "oci_logging_unified_agent_configurations" "test_unified_agent_configuration_monitoring_KUBERNETES" {
410+ # Required
411+ compartment_id = var. compartment_id
412+
413+ # Optional
414+ display_name = " test_unified_agent_configuration_monitoring_KUBERNETES"
415+ # group_id = var.test_log_group_id
416+ # is_compartment_id_in_subtree = var.unified_agent_configuration_is_compartment_id_in_subtree
417+ # log_id = var.test_log_id
418+ filter {
419+ name = " id"
420+ values = [oci_logging_unified_agent_configuration . test_unified_agent_configuration_monitoring_KUBERNETES . id ]
421+ }
422+ # state = var.unified_agent_configuration_state
423+ }
424+
425+
426+ resource "oci_logging_unified_agent_configuration" "test_unified_agent_configuration_monitoring_TAIL" {
427+ # Required
428+ compartment_id = var. compartment_id
429+ is_enabled = var. unified_agent_configuration_is_enabled
430+ service_configuration {
431+ # Required
432+ configuration_type = " MONITORING"
433+
434+ application_configurations {
435+ destination {
436+ compartment_id = var. compartment_id
437+ metrics_namespace = " tf_test_namespace"
438+ }
439+ source_type = " TAIL"
440+ sources {
441+ # Required
442+ source_type = " LOG_TAIL"
443+ name = " test_unified_agent_configuration_monitoring_1_sources_name_0"
444+ parser {
445+ parser_type = " JSON"
446+ field_time_key = " time"
447+ is_keep_time_key = true
448+ timeout_in_milliseconds = 1000
449+ }
450+ paths = [" /var/log/*" ]
451+ }
452+ sources {
453+ # Required
454+ source_type = " LOG_TAIL"
455+ name = " test_unified_agent_configuration_monitoring_1_sources_name_1"
456+ parser {
457+ parser_type = " REGEXP"
458+ expression = " regexp"
459+ }
460+ paths = [" /var/log1/*" ]
461+ }
462+ }
463+ }
464+
465+ # Optional
466+ defined_tags = {
467+ " ${var.tag_namespace1_name}.${var.tag1_name}" = var.log_group_defined_tags_value
468+ }
469+ description = var. unified_agent_configuration_description
470+ display_name = " test_unified_agent_configuration_monitoring_TAIL"
471+ freeform_tags = var. unified_agent_configuration_freeform_tags
472+ group_association {
473+ # Optional
474+ group_list = [" ocid1.dynamicgroup.oc1..aaaaaaaatqbpurg4jtr57dthka4lbykvsqajjmynecixwgsfgu2z36wf4kgq" ]
475+ }
476+
477+ lifecycle {
478+ ignore_changes = [ defined_tags ]
479+ }
480+ }
481+
482+ resource "oci_logging_unified_agent_configuration" "test_unified_agent_configuration_monitoring_URL" {
483+ # Required
484+ compartment_id = var. compartment_id
485+ is_enabled = var. unified_agent_configuration_is_enabled
486+ service_configuration {
487+ # Required
488+ configuration_type = " MONITORING"
489+
490+ application_configurations {
491+ destination {
492+ compartment_id = var. compartment_id
493+ metrics_namespace = " tf_test_namespace"
494+ }
495+ source_type = " URL"
496+ source {
497+ name = " url_source"
498+ scrape_targets {
499+ name = " url_scrape"
500+ url = " http://example.com"
501+ }
502+ }
503+ unified_agent_configuration_filter {
504+ filter_type = " URL_FILTER"
505+ name = " url_filter"
506+ allow_list = [" allow_list" ]
507+ deny_list = [" deny_list" ]
508+ }
509+ }
510+ }
511+
512+ # Optional
513+ defined_tags = {
514+ " ${var.tag_namespace1_name}.${var.tag1_name}" = var.log_group_defined_tags_value
515+ }
516+ description = var. unified_agent_configuration_description
517+ display_name = " test_unified_agent_configuration_monitoring_URL"
518+ freeform_tags = var. unified_agent_configuration_freeform_tags
519+ group_association {
520+ # Optional
521+ group_list = [" ocid1.dynamicgroup.oc1..aaaaaaaatqbpurg4jtr57dthka4lbykvsqajjmynecixwgsfgu2z36wf4kgq" ]
522+ }
523+
524+ lifecycle {
525+ ignore_changes = [ defined_tags ]
526+ }
527+ }
0 commit comments