|
| 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 | +} |
| 12 | + |
| 13 | +variable "publication_freeform_tags" { |
| 14 | + default = { "Department" = "Finance" } |
| 15 | +} |
| 16 | + |
| 17 | +variable "publication_is_agreement_acknowledged" { |
| 18 | + default = true |
| 19 | +} |
| 20 | + |
| 21 | +variable "publication_listing_type" { |
| 22 | + default = "COMMUNITY" |
| 23 | +} |
| 24 | + |
| 25 | +variable "publication_long_description" { |
| 26 | + default = "longDescription" |
| 27 | +} |
| 28 | + |
| 29 | +variable "publication_name" { |
| 30 | + default = "name" |
| 31 | +} |
| 32 | + |
| 33 | +variable "publication_names" { |
| 34 | + default = ["name"] |
| 35 | +} |
| 36 | + |
| 37 | +variable "publication_operating_systems" { |
| 38 | + default = [] |
| 39 | +} |
| 40 | + |
| 41 | +variable "publication_package_details_eula_eula_type" { |
| 42 | + default = "TEXT" |
| 43 | +} |
| 44 | + |
| 45 | +variable "publication_package_details_eula_license_text" { |
| 46 | + default = "licenseText" |
| 47 | +} |
| 48 | + |
| 49 | +variable "publication_package_details_operating_system_name" { |
| 50 | + default = "name" |
| 51 | +} |
| 52 | + |
| 53 | +variable "publication_package_details_package_type" { |
| 54 | + default = "IMAGE" |
| 55 | +} |
| 56 | + |
| 57 | +variable "publication_package_details_package_version" { |
| 58 | + default = "packageVersion" |
| 59 | +} |
| 60 | + |
| 61 | +variable "publication_short_description" { |
| 62 | + default = "shortDescription" |
| 63 | +} |
| 64 | + |
| 65 | +variable "publication_support_contacts_email" { |
| 66 | + default = "email" |
| 67 | +} |
| 68 | + |
| 69 | +variable "publication_support_contacts_name" { |
| 70 | + default = "name" |
| 71 | +} |
| 72 | + |
| 73 | +variable "publication_support_contacts_phone" { |
| 74 | + default = "phone" |
| 75 | +} |
| 76 | + |
| 77 | +variable "publication_support_contacts_subject" { |
| 78 | + default = "subject" |
| 79 | +} |
| 80 | + |
| 81 | +variable "image_id" { |
| 82 | + |
| 83 | +} |
| 84 | + |
| 85 | + |
| 86 | +provider "oci" { |
| 87 | + tenancy_ocid = var.tenancy_ocid |
| 88 | + user_ocid = var.user_ocid |
| 89 | + fingerprint = var.fingerprint |
| 90 | + private_key_path = var.private_key_path |
| 91 | + region = var.region |
| 92 | +} |
| 93 | + |
| 94 | +resource "oci_marketplace_publication" "test_publication" { |
| 95 | + #Required |
| 96 | + compartment_id = var.compartment_id |
| 97 | + is_agreement_acknowledged = var.publication_is_agreement_acknowledged |
| 98 | + listing_type = var.publication_listing_type |
| 99 | + name = var.publication_name |
| 100 | + package_details { |
| 101 | + #Required |
| 102 | + eula { |
| 103 | + #Required |
| 104 | + eula_type = var.publication_package_details_eula_eula_type |
| 105 | + |
| 106 | + #Optional |
| 107 | + license_text = var.publication_package_details_eula_license_text |
| 108 | + } |
| 109 | + operating_system { |
| 110 | + |
| 111 | + #Optional |
| 112 | + name = var.publication_package_details_operating_system_name |
| 113 | + } |
| 114 | + package_type = var.publication_package_details_package_type |
| 115 | + package_version = var.publication_package_details_package_version |
| 116 | + |
| 117 | + #Required |
| 118 | + image_id = var.image_id |
| 119 | + } |
| 120 | + short_description = var.publication_short_description |
| 121 | + support_contacts { |
| 122 | + |
| 123 | + #Optional |
| 124 | + email = var.publication_support_contacts_email |
| 125 | + name = var.publication_support_contacts_name |
| 126 | + phone = var.publication_support_contacts_phone |
| 127 | + subject = var.publication_support_contacts_subject |
| 128 | + } |
| 129 | + |
| 130 | + #Optional |
| 131 | + freeform_tags = var.publication_freeform_tags |
| 132 | + long_description = var.publication_long_description |
| 133 | +} |
| 134 | + |
| 135 | +data "oci_marketplace_publications" "test_publications" { |
| 136 | + #Required |
| 137 | + compartment_id = var.compartment_id |
| 138 | + listing_type = var.publication_listing_type |
| 139 | + |
| 140 | + #Optional |
| 141 | + name = var.publication_names |
| 142 | + operating_systems = var.publication_operating_systems |
| 143 | + publication_id = oci_marketplace_publication.test_publication.id |
| 144 | +} |
| 145 | + |
0 commit comments