|
| 1 | +// Copyright (c) 2017, 2023, 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 | + |
| 11 | +variable "apm_domain_description" { |
| 12 | + default = "description" |
| 13 | +} |
| 14 | + |
| 15 | +variable "apm_domain_display_name" { |
| 16 | + default = "displayName" |
| 17 | +} |
| 18 | + |
| 19 | +variable "apm_domain_freeform_tags" { |
| 20 | + default = { "Department" = "Finance" } |
| 21 | +} |
| 22 | + |
| 23 | +variable "apm_domain_is_free_tier" { |
| 24 | + default = false |
| 25 | +} |
| 26 | + |
| 27 | +variable "apm_domain_state" { |
| 28 | + default = "ACTIVE" |
| 29 | +} |
| 30 | + |
| 31 | +variable "data_key_data_key_type" { |
| 32 | + default = "PRIVATE" |
| 33 | +} |
| 34 | + |
| 35 | +provider "oci" { |
| 36 | + tenancy_ocid = var.tenancy_ocid |
| 37 | + user_ocid = var.user_ocid |
| 38 | + fingerprint = var.fingerprint |
| 39 | + private_key_path = var.private_key_path |
| 40 | + region = var.region |
| 41 | +} |
| 42 | + |
| 43 | + |
| 44 | +variable "on_premise_vantage_point_display_name" { |
| 45 | + default = "displayName" |
| 46 | +} |
| 47 | + |
| 48 | +variable "on_premise_vantage_point_name" { |
| 49 | + default = "OPVP-name" |
| 50 | +} |
| 51 | + |
| 52 | + |
| 53 | +resource "oci_apm_apm_domain" "test_apm_domain" { |
| 54 | + #Required |
| 55 | + compartment_id = var.compartment_ocid |
| 56 | + display_name = var.apm_domain_display_name |
| 57 | + |
| 58 | + #Optional |
| 59 | + description = var.apm_domain_description |
| 60 | + freeform_tags = var.apm_domain_freeform_tags |
| 61 | + is_free_tier = var.apm_domain_is_free_tier |
| 62 | +} |
| 63 | + |
| 64 | +resource "oci_apm_synthetics_on_premise_vantage_point" "test_on_premise_vantage_point" { |
| 65 | + #Required |
| 66 | + apm_domain_id = oci_apm_apm_domain.test_apm_domain.id |
| 67 | + name = var.on_premise_vantage_point_name |
| 68 | +} |
| 69 | + |
| 70 | + |
| 71 | +data "oci_apm_synthetics_on_premise_vantage_points" "test_on_premise_vantage_points" { |
| 72 | + #Required |
| 73 | + apm_domain_id = oci_apm_apm_domain.test_apm_domain.id |
| 74 | + |
| 75 | + #Optional |
| 76 | + name = var.on_premise_vantage_point_name |
| 77 | +} |
| 78 | + |
| 79 | +variable "on_premise_vantage_point_worker_name" { |
| 80 | + default = "worker" |
| 81 | +} |
| 82 | + |
| 83 | +variable "on_premise_vantage_point_worker_version" { |
| 84 | + default = "1.2.4" |
| 85 | +} |
| 86 | + |
| 87 | +variable "on_premise_vantage_point_worker_resource_principal_token_public_key" { |
| 88 | + default = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0GuJMVpuYE3l2pAe4mwrB73pExN42hG5OkbiJimrSbSHBffng6NacHz4hX8Ri9WhuQSq51nXsGjixnVvjnI3RzgenAaLVrf48a8RmS5D0pwrjshkf5Vt/hSXYL2lVUToGTUdOzXb5ZAH6BN9SE+LPEeBl6QnXn90teMXeVPnarg9WE1LMf8eNoD3PRaXEa9i3Q0Q2/3cfXVX1MhHk5wi/fUKsnbTjy67a49vvC3DKbakw76q4lrdtvp7M5EKN+paD0qg64wRKn8/bCYvI/tjM+LufvSLJJSj7KQs83t5xKBK60FVRUK/d3bRdilb8XnezBSGSdPDY9fL6yn0z8UORQIDAQAB\n-----END PUBLIC KEY-----" |
| 89 | +} |
| 90 | + |
| 91 | + |
| 92 | +resource "oci_apm_synthetics_on_premise_vantage_point_worker" "test_on_premise_vantage_point_worker" { |
| 93 | + #Required |
| 94 | + apm_domain_id = oci_apm_apm_domain.test_apm_domain.id |
| 95 | + on_premise_vantage_point_id = oci_apm_synthetics_on_premise_vantage_point.test_on_premise_vantage_point.id |
| 96 | + name = var.on_premise_vantage_point_worker_name |
| 97 | + version = var.on_premise_vantage_point_worker_version |
| 98 | + resource_principal_token_public_key = var.on_premise_vantage_point_worker_resource_principal_token_public_key |
| 99 | +} |
| 100 | + |
| 101 | +data "oci_apm_synthetics_on_premise_vantage_point_workers" "test_on_premise_vantage_point_workers" { |
| 102 | + #Required |
| 103 | + apm_domain_id = oci_apm_apm_domain.test_apm_domain.id |
| 104 | + on_premise_vantage_point_id = oci_apm_synthetics_on_premise_vantage_point.test_on_premise_vantage_point.id |
| 105 | + name = var.on_premise_vantage_point_name |
| 106 | + |
| 107 | + #Optional |
| 108 | +} |
0 commit comments