-
Notifications
You must be signed in to change notification settings - Fork 9
/
freebsd.tf
61 lines (60 loc) · 3.83 KB
/
freebsd.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
# "FreeBSD OS"
resource "oci_marketplace_accepted_agreement" "freebsd_accepted_agreement" {
agreement_id = oci_marketplace_listing_package_agreement.freebsd_package_agreement.agreement_id
compartment_id = var.tenancy_ocid
listing_id = data.oci_marketplace_listing.freebsd.id
package_version = data.oci_marketplace_listing.freebsd.default_package_version
signature = oci_marketplace_listing_package_agreement.freebsd_package_agreement.signature
}
resource "oci_marketplace_listing_package_agreement" "freebsd_package_agreement" {
agreement_id = data.oci_marketplace_listing_package_agreements.freebsd_package_agreements.agreements[0].id
listing_id = data.oci_marketplace_listing.freebsd.id
package_version = data.oci_marketplace_listing.freebsd.default_package_version
}
data "oci_marketplace_listings" "freebsd" {
pricing = ["Free"]
name = ["FreeBSD"]
compartment_id = var.tenancy_ocid
}
data "oci_marketplace_listing_package_agreements" "freebsd_package_agreements" {
listing_id = data.oci_marketplace_listing.freebsd.id
package_version = data.oci_marketplace_listing.freebsd.default_package_version
compartment_id = var.tenancy_ocid
}
data "oci_marketplace_listing_package" "freebsd_package" {
listing_id = data.oci_marketplace_listing.freebsd.id
package_version = data.oci_marketplace_listing.freebsd.default_package_version
compartment_id = var.tenancy_ocid
}
data "oci_marketplace_listing_packages" "freebsd_packages" {
listing_id = data.oci_marketplace_listing.freebsd.id
compartment_id = var.tenancy_ocid
}
data "oci_marketplace_listing" "freebsd" {
listing_id = data.oci_marketplace_listings.freebsd.listings[0].id
compartment_id = var.tenancy_ocid
}
data "oci_core_app_catalog_listing_resource_versions" "freebsd_app_catalog_listing_resource_versions" {
listing_id = data.oci_marketplace_listing_package.freebsd_package.app_catalog_listing_id
}
data "oci_core_app_catalog_listing_resource_version" "freebsd_catalog_listing" {
listing_id = data.oci_marketplace_listing_package.freebsd_package.app_catalog_listing_id
resource_version = data.oci_marketplace_listing_package.freebsd_package.app_catalog_listing_resource_version
}
resource "oci_core_app_catalog_listing_resource_version_agreement" "freebsd_app_catalog_listing_resource_version_agreement" {
listing_id = data.oci_marketplace_listing_package.freebsd_package.app_catalog_listing_id
listing_resource_version = data.oci_core_app_catalog_listing_resource_versions.freebsd_app_catalog_listing_resource_versions.app_catalog_listing_resource_versions[0].listing_resource_version
}
resource "oci_core_app_catalog_subscription" "freebsd_app_catalog_subscription" {
compartment_id = var.tenancy_ocid
eula_link = oci_core_app_catalog_listing_resource_version_agreement.freebsd_app_catalog_listing_resource_version_agreement.eula_link
listing_id = oci_core_app_catalog_listing_resource_version_agreement.freebsd_app_catalog_listing_resource_version_agreement.listing_id
listing_resource_version = oci_core_app_catalog_listing_resource_version_agreement.freebsd_app_catalog_listing_resource_version_agreement.listing_resource_version
oracle_terms_of_use_link = oci_core_app_catalog_listing_resource_version_agreement.freebsd_app_catalog_listing_resource_version_agreement.oracle_terms_of_use_link
signature = oci_core_app_catalog_listing_resource_version_agreement.freebsd_app_catalog_listing_resource_version_agreement.signature
time_retrieved = oci_core_app_catalog_listing_resource_version_agreement.freebsd_app_catalog_listing_resource_version_agreement.time_retrieved
}
# Output OCI FreeBSD Image ID
output OCI_FreeBSD_OS_Image_id {
value = data.oci_core_app_catalog_listing_resource_version.freebsd_catalog_listing.listing_resource_id
}