forked from oracle-quickstart/oci-hpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
marketplace.tf
executable file
·75 lines (62 loc) · 3.52 KB
/
marketplace.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
locals {
// listing_number = split(".", var.marketplace_listing)[0]
mp_listing_id = var.use_marketplace_image ? var.marketplace_listing_id : ""
mp_bastion_listing_id = var.use_standard_image ? var.marketplace_listing_id : ""
mp_version_id = split(".", var.marketplace_listing)[0]
mp_bastion_version_id = split(".", var.bastion_listing)[0]
}
/*
output "debug" {
value = data.oci_core_app_catalog_listing_resource_versions.app_catalog_listing_resource_versions.app_catalog_listing_resource_versions[0].listing_resource_id
}
*/
/*
data "oci_core_app_catalog_listing" "app_catalog_listing" {
count = var.use_marketplace_image ? 1 : 0
listing_id = local.mp_listing_id
}
*/
data "oci_core_app_catalog_listing_resource_versions" "app_catalog_listing_resource_versions" {
count = var.use_marketplace_image ? 1 : 0
listing_id = local.mp_listing_id
}
resource "oci_core_app_catalog_listing_resource_version_agreement" "mp_image_agreement" {
count = var.use_marketplace_image ? 1 : 0
listing_id = local.mp_listing_id
listing_resource_version = var.marketplace_version_id[local.mp_version_id]
}
resource "oci_core_app_catalog_subscription" "mp_image_subscription" {
count = var.use_marketplace_image ? 1 : 0
compartment_id = var.targetCompartment
eula_link = oci_core_app_catalog_listing_resource_version_agreement.mp_image_agreement[0].eula_link
listing_id = oci_core_app_catalog_listing_resource_version_agreement.mp_image_agreement[0].listing_id
listing_resource_version = oci_core_app_catalog_listing_resource_version_agreement.mp_image_agreement[0].listing_resource_version
oracle_terms_of_use_link = oci_core_app_catalog_listing_resource_version_agreement.mp_image_agreement[0].oracle_terms_of_use_link
signature = oci_core_app_catalog_listing_resource_version_agreement.mp_image_agreement[0].signature
time_retrieved = oci_core_app_catalog_listing_resource_version_agreement.mp_image_agreement[0].time_retrieved
timeouts {
create = "20m"
}
}
data "oci_core_app_catalog_listing_resource_versions" "bastion_app_catalog_listing_resource_versions" {
count = var.use_standard_image ? 1 : 0
listing_id = local.mp_bastion_listing_id
}
resource "oci_core_app_catalog_listing_resource_version_agreement" "bastion_mp_image_agreement" {
count = var.use_standard_image ? 1 : 0
listing_id = local.mp_bastion_listing_id
listing_resource_version = var.marketplace_version_id[local.mp_bastion_version_id]
}
resource "oci_core_app_catalog_subscription" "bastion_mp_image_subscription" {
count = var.use_standard_image ? 1 : 0
compartment_id = var.targetCompartment
eula_link = oci_core_app_catalog_listing_resource_version_agreement.bastion_mp_image_agreement[0].eula_link
listing_id = oci_core_app_catalog_listing_resource_version_agreement.bastion_mp_image_agreement[0].listing_id
listing_resource_version = oci_core_app_catalog_listing_resource_version_agreement.bastion_mp_image_agreement[0].listing_resource_version
oracle_terms_of_use_link = oci_core_app_catalog_listing_resource_version_agreement.bastion_mp_image_agreement[0].oracle_terms_of_use_link
signature = oci_core_app_catalog_listing_resource_version_agreement.bastion_mp_image_agreement[0].signature
time_retrieved = oci_core_app_catalog_listing_resource_version_agreement.bastion_mp_image_agreement[0].time_retrieved
timeouts {
create = "20m"
}
}