|
| 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 "vbs_instance_defined_tags_value" { |
| 12 | + default = "value" |
| 13 | +} |
| 14 | + |
| 15 | +variable "vbs_instance_display_name" { |
| 16 | + default = "displayName" |
| 17 | +} |
| 18 | + |
| 19 | +variable "vbs_instance_freeform_tags" { |
| 20 | + default = { "bar-key" = "value" } |
| 21 | +} |
| 22 | + |
| 23 | +variable "vbs_instance_id" { |
| 24 | + default = "id" |
| 25 | +} |
| 26 | + |
| 27 | +variable "vbs_instance_idcs_access_token" { |
| 28 | + default = "idcsAccessToken" |
| 29 | +} |
| 30 | + |
| 31 | +variable "vbs_instance_is_resource_usage_agreement_granted" { |
| 32 | + default = true |
| 33 | +} |
| 34 | + |
| 35 | +variable "vbs_instance_name" { |
| 36 | + default = "name" |
| 37 | +} |
| 38 | + |
| 39 | +variable "vbs_instance_state" { |
| 40 | + default = "ACTIVE" |
| 41 | +} |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +provider "oci" { |
| 46 | + tenancy_ocid = var.tenancy_ocid |
| 47 | + user_ocid = var.user_ocid |
| 48 | + fingerprint = var.fingerprint |
| 49 | + private_key_path = var.private_key_path |
| 50 | + region = var.region |
| 51 | +} |
| 52 | + |
| 53 | +resource "oci_vbs_inst_vbs_instance" "test_vbs_instance" { |
| 54 | + #Required |
| 55 | + compartment_id = var.compartment_id |
| 56 | + display_name = var.vbs_instance_display_name |
| 57 | + name = var.vbs_instance_name |
| 58 | + |
| 59 | + #Optional |
| 60 | + #defined_tags = map(oci_identity_tag_namespace.tag-namespace1.name.oci_identity_tag.tag1.name, var.vbs_instance_defined_tags_value) |
| 61 | + freeform_tags = var.vbs_instance_freeform_tags |
| 62 | + #idcs_access_token = var.vbs_instance_idcs_access_token |
| 63 | + is_resource_usage_agreement_granted = var.vbs_instance_is_resource_usage_agreement_granted |
| 64 | + resource_compartment_id = var.resource_compartment_id |
| 65 | +} |
| 66 | + |
| 67 | +data "oci_vbs_inst_vbs_instances" "test_vbs_instances" { |
| 68 | + #Required |
| 69 | + compartment_id = var.compartment_id |
| 70 | + |
| 71 | + #Optional |
| 72 | + id = var.vbs_instance_id |
| 73 | + name = var.vbs_instance_name |
| 74 | + state = var.vbs_instance_state |
| 75 | +} |
| 76 | + |
0 commit comments