-
Notifications
You must be signed in to change notification settings - Fork 26
/
marketplace.tf
executable file
·114 lines (95 loc) · 6.91 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
locals {
// listing_number = split(".", var.marketplace_listing)[0]
mp_listing_id = var.use_marketplace_image ? substr(var.marketplace_listing, 0, 3) == "HPC" ? var.marketplace_listing_id_HPC : var.marketplace_listing_id_GPU : ""
mp_controller_listing_id = var.use_marketplace_image_controller ? substr(var.marketplace_listing_controller, 0, 3) == "HPC" ? var.marketplace_listing_id_HPC : var.marketplace_listing_id_GPU : ""
mp_login_listing_id = var.use_marketplace_image_login ? substr(var.marketplace_listing_login, 0, 3) == "HPC" ? var.marketplace_listing_id_HPC : var.marketplace_listing_id_GPU : ""
mp_monitoring_listing_id = var.use_marketplace_image_monitoring ? substr(var.marketplace_listing_monitoring, 0, 3) == "HPC" ? var.marketplace_listing_id_HPC : var.marketplace_listing_id_GPU : ""
mp_version_id = var.marketplace_version_id[var.marketplace_listing]
mp_controller_version_id = var.marketplace_version_id[var.marketplace_listing_controller]
mp_login_version_id = var.marketplace_version_id[var.marketplace_listing_login]
mp_monitoring_version_id = var.marketplace_version_id[var.marketplace_listing_monitoring]
}
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 = 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" "controller_app_catalog_listing_resource_versions" {
count = var.use_marketplace_image_controller ? 1 : 0
listing_id = local.mp_controller_listing_id
}
resource "oci_core_app_catalog_listing_resource_version_agreement" "controller_mp_image_agreement" {
count = (var.use_marketplace_image_controller) ? 1 : 0
listing_id = local.mp_controller_listing_id
listing_resource_version = local.mp_controller_version_id
}
resource "oci_core_app_catalog_subscription" "controller_mp_image_subscription" {
count = (var.use_marketplace_image_controller) ? 1 : 0
compartment_id = var.targetCompartment
eula_link = oci_core_app_catalog_listing_resource_version_agreement.controller_mp_image_agreement[0].eula_link
listing_id = oci_core_app_catalog_listing_resource_version_agreement.controller_mp_image_agreement[0].listing_id
listing_resource_version = oci_core_app_catalog_listing_resource_version_agreement.controller_mp_image_agreement[0].listing_resource_version
oracle_terms_of_use_link = oci_core_app_catalog_listing_resource_version_agreement.controller_mp_image_agreement[0].oracle_terms_of_use_link
signature = oci_core_app_catalog_listing_resource_version_agreement.controller_mp_image_agreement[0].signature
time_retrieved = oci_core_app_catalog_listing_resource_version_agreement.controller_mp_image_agreement[0].time_retrieved
timeouts {
create = "20m"
}
}
data "oci_core_app_catalog_listing_resource_versions" "login_app_catalog_listing_resource_versions" {
count = var.login_node && var.use_marketplace_image_login ? 1 : 0
listing_id = local.mp_login_listing_id
}
data "oci_core_app_catalog_listing_resource_versions" "monitoring_app_catalog_listing_resource_versions" {
count = var.monitoring_node && var.use_marketplace_image_monitoring ? 1 : 0
listing_id = local.mp_monitoring_listing_id
}
resource "oci_core_app_catalog_listing_resource_version_agreement" "login_mp_image_agreement" {
count = var.login_node && var.use_marketplace_image_login ? 1 : 0
listing_id = local.mp_login_listing_id
listing_resource_version = local.mp_login_version_id
}
resource "oci_core_app_catalog_listing_resource_version_agreement" "monitoring_mp_image_agreement" {
count = var.monitoring_node && var.use_marketplace_image_monitoring ? 1 : 0
listing_id = local.mp_monitoring_listing_id
listing_resource_version = local.mp_monitoring_version_id
}
resource "oci_core_app_catalog_subscription" "login_mp_image_subscription" {
count = var.login_node && var.use_marketplace_image_login ? 1 : 0
compartment_id = var.targetCompartment
eula_link = oci_core_app_catalog_listing_resource_version_agreement.login_mp_image_agreement[0].eula_link
listing_id = oci_core_app_catalog_listing_resource_version_agreement.login_mp_image_agreement[0].listing_id
listing_resource_version = oci_core_app_catalog_listing_resource_version_agreement.login_mp_image_agreement[0].listing_resource_version
oracle_terms_of_use_link = oci_core_app_catalog_listing_resource_version_agreement.login_mp_image_agreement[0].oracle_terms_of_use_link
signature = oci_core_app_catalog_listing_resource_version_agreement.login_mp_image_agreement[0].signature
time_retrieved = oci_core_app_catalog_listing_resource_version_agreement.login_mp_image_agreement[0].time_retrieved
timeouts {
create = "20m"
}
}
resource "oci_core_app_catalog_subscription" "monitoring_mp_image_subscription" {
count = var.monitoring_node && var.use_marketplace_image_monitoring ? 1 : 0
compartment_id = var.targetCompartment
eula_link = oci_core_app_catalog_listing_resource_version_agreement.monitoring_mp_image_agreement[0].eula_link
listing_id = oci_core_app_catalog_listing_resource_version_agreement.monitoring_mp_image_agreement[0].listing_id
listing_resource_version = oci_core_app_catalog_listing_resource_version_agreement.monitoring_mp_image_agreement[0].listing_resource_version
oracle_terms_of_use_link = oci_core_app_catalog_listing_resource_version_agreement.monitoring_mp_image_agreement[0].oracle_terms_of_use_link
signature = oci_core_app_catalog_listing_resource_version_agreement.monitoring_mp_image_agreement[0].signature
time_retrieved = oci_core_app_catalog_listing_resource_version_agreement.monitoring_mp_image_agreement[0].time_retrieved
timeouts {
create = "20m"
}
}