|
| 1 | +// Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. |
| 2 | +// Licensed under the Mozilla Public License v2.0 |
| 3 | + |
| 4 | +variable "tenancy_ocid" { } |
| 5 | +variable "user_ocid" { } |
| 6 | +variable "fingerprint" { } |
| 7 | +variable "private_key_path" { } |
| 8 | +variable "region" { } |
| 9 | +variable "compartment_ocid" { } |
| 10 | +variable "management_agent_ocid" { } |
| 11 | + |
| 12 | +variable "config_config_type" { |
| 13 | + default = "MACS_APM_EXTENSION" |
| 14 | +} |
| 15 | + |
| 16 | +variable "process_filter" { |
| 17 | + default = [".*org.apache.catalina.startup.Bootstrap.*", ".*jetty.*"] |
| 18 | +} |
| 19 | + |
| 20 | +variable "run_as_user" { |
| 21 | + default = "tomcat" |
| 22 | +} |
| 23 | + |
| 24 | +variable "service_name" { |
| 25 | + default = "Tomcat" |
| 26 | +} |
| 27 | + |
| 28 | +variable "agent_version" { |
| 29 | + default = "1.16.0.585" |
| 30 | +} |
| 31 | + |
| 32 | +variable "attach_install_dir" { |
| 33 | + default = "/opt/oracle/apm_attach_process" |
| 34 | +} |
| 35 | + |
| 36 | +variable "display_name" { |
| 37 | + default = "Display name" |
| 38 | +} |
| 39 | + |
| 40 | +variable "config_defined_tags_value" { |
| 41 | + default = "value" |
| 42 | +} |
| 43 | + |
| 44 | +variable "config_freeform_tags" { |
| 45 | + default = { "bar-key" = "value" } |
| 46 | +} |
| 47 | + |
| 48 | +variable "apm_domain_description" { |
| 49 | + default = "description" |
| 50 | +} |
| 51 | + |
| 52 | +variable "apm_domain_display_name" { |
| 53 | + default = "displayName" |
| 54 | +} |
| 55 | + |
| 56 | +variable "apm_domain_freeform_tags" { |
| 57 | + default = { "Department" = "Finance" } |
| 58 | +} |
| 59 | + |
| 60 | +variable "apm_domain_is_free_tier" { |
| 61 | + default = false |
| 62 | +} |
| 63 | + |
| 64 | +variable "apm_domain_state" { |
| 65 | + default = "ACTIVE" |
| 66 | +} |
| 67 | + |
| 68 | +variable "data_key_data_key_type" { |
| 69 | + default = "PRIVATE" |
| 70 | +} |
| 71 | + |
| 72 | +provider "oci" { |
| 73 | + tenancy_ocid = var.tenancy_ocid |
| 74 | + user_ocid = var.user_ocid |
| 75 | + fingerprint = var.fingerprint |
| 76 | + private_key_path = var.private_key_path |
| 77 | + region = var.region |
| 78 | +} |
| 79 | + |
| 80 | +resource "oci_apm_apm_domain" "test_apm_domain" { |
| 81 | + #Required |
| 82 | + compartment_id = var.compartment_ocid |
| 83 | + display_name = var.apm_domain_display_name |
| 84 | + |
| 85 | + #Optional |
| 86 | + description = var.apm_domain_description |
| 87 | + freeform_tags = var.apm_domain_freeform_tags |
| 88 | + is_free_tier = true |
| 89 | +} |
| 90 | + |
| 91 | + |
| 92 | +resource "oci_apm_config_config" "test_config" { |
| 93 | + #Required |
| 94 | + apm_domain_id = oci_apm_apm_domain.test_apm_domain.id |
| 95 | + config_type = var.config_config_type |
| 96 | + management_agent_id = var.management_agent_ocid |
| 97 | + process_filter = var.process_filter |
| 98 | + run_as_user = var.run_as_user |
| 99 | + service_name = var.service_name |
| 100 | + agent_version = var.agent_version |
| 101 | + attach_install_dir = var.attach_install_dir |
| 102 | + |
| 103 | + #Optional |
| 104 | + display_name = var.display_name |
| 105 | +} |
| 106 | + |
| 107 | +data "oci_apm_config_configs" "test_configs" { |
| 108 | + #Required |
| 109 | + apm_domain_id = oci_apm_apm_domain.test_apm_domain.id |
| 110 | + |
| 111 | + #Optional |
| 112 | + config_type = var.config_config_type |
| 113 | +} |
0 commit comments