|
| 1 | +// Copyright (c) 2017, 2021, 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_id" {} |
| 10 | + |
| 11 | +variable "asset_source_are_historical_metrics_collected" { |
| 12 | + default = false |
| 13 | +} |
| 14 | + |
| 15 | +variable "asset_source_are_realtime_metrics_collected" { |
| 16 | + default = false |
| 17 | +} |
| 18 | + |
| 19 | +variable "asset_source_defined_tags_value" { |
| 20 | + default = "value" |
| 21 | +} |
| 22 | + |
| 23 | +variable "asset_source_discovery_credentials_type" { |
| 24 | + default = "BASIC" |
| 25 | +} |
| 26 | + |
| 27 | +variable "asset_source_display_name" { |
| 28 | + default = "displayName" |
| 29 | +} |
| 30 | + |
| 31 | +variable "asset_source_freeform_tags" { |
| 32 | + default = { "Department" = "Finance" } |
| 33 | +} |
| 34 | + |
| 35 | +variable "asset_source_replication_credentials_type" { |
| 36 | + default = "BASIC" |
| 37 | +} |
| 38 | + |
| 39 | +variable "asset_source_state" { |
| 40 | + default = "AVAILABLE" |
| 41 | +} |
| 42 | + |
| 43 | +variable "asset_source_system_tags" { |
| 44 | + default = "value" |
| 45 | +} |
| 46 | + |
| 47 | +variable "asset_source_type" { |
| 48 | + default = "VMWARE" |
| 49 | +} |
| 50 | + |
| 51 | +variable "asset_source_vcenter_endpoint" { |
| 52 | + default = "vcenterEndpoint" |
| 53 | +} |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | +provider "oci" { |
| 58 | + tenancy_ocid = var.tenancy_ocid |
| 59 | + user_ocid = var.user_ocid |
| 60 | + fingerprint = var.fingerprint |
| 61 | + private_key_path = var.private_key_path |
| 62 | + region = var.region |
| 63 | +} |
| 64 | + |
| 65 | +resource "oci_cloud_bridge_asset_source" "test_asset_source" { |
| 66 | + #Required |
| 67 | + assets_compartment_id = oci_identity_compartment.test_compartment.id |
| 68 | + compartment_id = var.compartment_id |
| 69 | + discovery_credentials { |
| 70 | + #Required |
| 71 | + secret_id = oci_vault_secret.test_secret.id |
| 72 | + type = var.asset_source_discovery_credentials_type |
| 73 | + } |
| 74 | + environment_id = oci_cloud_bridge_environment.test_environment.id |
| 75 | + inventory_id = oci_cloud_bridge_inventory.test_inventory.id |
| 76 | + type = var.asset_source_type |
| 77 | + vcenter_endpoint = var.asset_source_vcenter_endpoint |
| 78 | + |
| 79 | + #Optional |
| 80 | + are_historical_metrics_collected = var.asset_source_are_historical_metrics_collected |
| 81 | + are_realtime_metrics_collected = var.asset_source_are_realtime_metrics_collected |
| 82 | + defined_tags = map(oci_identity_tag_namespace.tag-namespace1.name.oci_identity_tag.tag1.name, var.asset_source_defined_tags_value) |
| 83 | + discovery_schedule_id = oci_cloud_bridge_discovery_schedule.test_discovery_schedule.id |
| 84 | + display_name = var.asset_source_display_name |
| 85 | + freeform_tags = var.asset_source_freeform_tags |
| 86 | + replication_credentials { |
| 87 | + #Required |
| 88 | + secret_id = oci_vault_secret.test_secret.id |
| 89 | + type = var.asset_source_replication_credentials_type |
| 90 | + } |
| 91 | + system_tags = var.asset_source_system_tags |
| 92 | +} |
| 93 | + |
| 94 | +data "oci_cloud_bridge_asset_sources" "test_asset_sources" { |
| 95 | + #Required |
| 96 | + compartment_id = var.compartment_id |
| 97 | + |
| 98 | + #Optional |
| 99 | + asset_source_id = oci_cloud_bridge_asset_source.test_asset_source.id |
| 100 | + display_name = var.asset_source_display_name |
| 101 | + state = var.asset_source_state |
| 102 | +} |
| 103 | + |
0 commit comments