Skip to content

Commit 99fb347

Browse files
Merge pull request #100 from oracle-devrel/iopanait-develop38
Iopanait develop38
2 parents e3e8d35 + bab27be commit 99fb347

File tree

92 files changed

+9657
-22
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+9657
-22
lines changed

cloud-foundation/modules/cloud-foundation-library/big-data-service/main.tf

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,14 @@ resource "oci_bds_bds_instance" "this" {
6969
# }
7070
# }
7171
# }
72-
# }
72+
# }
73+
74+
terraform {
75+
required_providers {
76+
oci = {
77+
source = "oracle/oci"
78+
version = ">= 5.30.0"
79+
}
80+
}
81+
required_version = ">= 1.5.5"
82+
}

cloud-foundation/modules/cloud-foundation-library/database/adb/main.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,13 @@ resource "oci_database_autonomous_database" "adw" {
4040
operations_insights_status = each.value.operations_insights_status
4141
database_management_status = each.value.database_management_status
4242
}
43+
44+
terraform {
45+
required_providers {
46+
oci = {
47+
source = "oracle/oci"
48+
version = ">= 5.30.0"
49+
}
50+
}
51+
required_version = ">= 1.5.5"
52+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright © 2024, Oracle and/or its affiliates.
2+
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
resource "oci_datacatalog_catalog" "this" {
5+
for_each = var.datacatalog_params
6+
compartment_id = each.value.compartment_id
7+
display_name = each.value.catalog_display_name
8+
defined_tags = each.value.defined_tags
9+
}
10+
11+
resource "oci_datacatalog_data_asset" "this" {
12+
for_each = var.datacatalog_params
13+
catalog_id = oci_datacatalog_catalog.this[each.key].id
14+
display_name = each.value.catalog_display_name
15+
type_key = data.oci_datacatalog_catalog_types.this[each.key].type_collection[0].items[0].key
16+
properties = {
17+
"default.database" = var.db_name
18+
"default.privateendpoint" = "false"
19+
}
20+
}
21+
22+
data "oci_datacatalog_catalog_types" "this" {
23+
for_each = var.datacatalog_params
24+
catalog_id = oci_datacatalog_catalog.this[each.key].id
25+
type_category = "dataAsset"
26+
name = "Autonomous Data Warehouse"
27+
state = "ACTIVE"
28+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright © 2024, Oracle and/or its affiliates.
2+
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
output "datacatalog" {
5+
value = {
6+
for datacatalog in oci_datacatalog_catalog.this:
7+
datacatalog.display_name => datacatalog.display_name
8+
}
9+
}
10+
11+
output "datacatalog_data_asset" {
12+
value = {
13+
for datacatalog_data_asset in oci_datacatalog_data_asset.this:
14+
datacatalog_data_asset.display_name => datacatalog_data_asset.display_name
15+
}
16+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright © 2024, Oracle and/or its affiliates.
2+
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
variable "datacatalog_params" {
5+
type = map(object({
6+
compartment_id = string
7+
catalog_display_name = string
8+
defined_tags = map(string)
9+
}))
10+
}
11+
12+
variable "db_name" {
13+
type = string
14+
}

cloud-foundation/modules/cloud-foundation-library/instance_with_out_flexible/instance.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,13 @@ resource "oci_core_instance" "instance" {
4646
ignore_changes = all
4747
}
4848
}
49+
50+
terraform {
51+
required_providers {
52+
oci = {
53+
source = "oracle/oci"
54+
version = ">= 5.30.0"
55+
}
56+
}
57+
required_version = ">= 1.5.5"
58+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Copyright © 2022, Oracle and/or its affiliates.
2+
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
data "oci_identity_availability_domains" "ADs" {
5+
compartment_id = var.tenancy_ocid
6+
}
7+
8+
9+
resource "oci_core_instance" "instance" {
10+
11+
for_each = var.instance_params
12+
13+
availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[each.value.availability_domain - 1].name
14+
compartment_id = each.value.compartment_id
15+
display_name = each.value.display_name
16+
shape = each.value.shape
17+
18+
defined_tags = each.value.defined_tags
19+
freeform_tags = each.value.freeform_tags
20+
21+
create_vnic_details {
22+
subnet_id = each.value.subnet_id
23+
display_name = each.value.vnic_display_name
24+
assign_public_ip = each.value.assign_public_ip
25+
hostname_label = each.value.hostname_label
26+
}
27+
28+
source_details {
29+
source_type = each.value.source_type
30+
source_id = each.value.source_id
31+
boot_volume_size_in_gbs = each.value.boot_volume_size_in_gbs
32+
}
33+
34+
metadata = each.value.metadata
35+
36+
fault_domain = each.value.fault_domain
37+
38+
timeouts {
39+
create = "${each.value.provisioning_timeout_mins}m"
40+
}
41+
42+
#prevent any metadata changes to destroy instance
43+
# lifecycle {
44+
# ignore_changes = [metadata, shape, shape_config]
45+
# }
46+
lifecycle {
47+
ignore_changes = all
48+
}
49+
}
50+
51+
terraform {
52+
required_providers {
53+
oci = {
54+
source = "oracle/oci"
55+
version = ">= 5.30.0"
56+
}
57+
}
58+
required_version = ">= 1.5.5"
59+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Copyright © 2022, Oracle and/or its affiliates.
2+
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
# Output the private and public IPs of the instance
5+
6+
output "InstancePrivateIPs" {
7+
value = [ for b in oci_core_instance.instance : b.private_ip]
8+
}
9+
10+
output "InstancePublicIPs" {
11+
value = [ for b in oci_core_instance.instance : b.public_ip]
12+
}
13+
14+
output "InstanceOcids" {
15+
value = [ for b in oci_core_instance.instance : b.id]
16+
}
17+
18+
output "display_names" {
19+
value = [ for b in oci_core_instance.instance : b.display_name]
20+
}
21+
22+
output "InstanceShapes" {
23+
value = [ for b in oci_core_instance.instance : b.shape]
24+
}
25+
26+
output "AvailabilityDomains" {
27+
value = [ for b in oci_core_instance.instance : b.availability_domain]
28+
}
29+
30+
locals {
31+
linux_instances = {
32+
for instance in oci_core_instance.instance :
33+
instance.display_name => { "id" : instance.id, "ip" : instance.public_ip != "" ? instance.public_ip : instance.private_ip }
34+
}
35+
36+
linux_ids = {
37+
for instance in oci_core_instance.instance :
38+
instance.display_name => instance.id
39+
}
40+
41+
linux_private_ips = {
42+
for instance in oci_core_instance.instance :
43+
instance.display_name => instance.private_ip
44+
}
45+
46+
linux_public_ips = {
47+
for instance in oci_core_instance.instance :
48+
instance.display_name => instance.public_ip
49+
}
50+
51+
all_instances = local.linux_ids
52+
all_private_ips = local.linux_private_ips
53+
all_public_ips = local.linux_public_ips
54+
}
55+
56+
output "linux_instances" {
57+
value = local.linux_instances
58+
}
59+
60+
output "all_instances" {
61+
value = local.all_instances
62+
}
63+
64+
output "all_private_ips" {
65+
value = local.all_private_ips
66+
}
67+
68+
output "all_public_ips" {
69+
value = local.all_public_ips
70+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright © 2022, Oracle and/or its affiliates.
2+
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
variable "tenancy_ocid" {
5+
type = string
6+
}
7+
8+
variable "instance_params" {
9+
10+
type = map(object({
11+
12+
availability_domain = number
13+
compartment_id = string
14+
display_name = string
15+
shape = string
16+
17+
defined_tags = map(string)
18+
freeform_tags = map(string)
19+
20+
subnet_id = string
21+
vnic_display_name = string
22+
assign_public_ip = string
23+
hostname_label = string
24+
25+
source_type = string
26+
source_id = string
27+
boot_volume_size_in_gbs = number
28+
29+
metadata = map(string)
30+
31+
fault_domain = string
32+
33+
provisioning_timeout_mins = string
34+
35+
}))
36+
37+
}

cloud-foundation/modules/cloud-foundation-library/keygen/keygen.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,13 @@ resource "tls_self_signed_cert" "demo_cert" {
4040
"crl_signing",
4141
]
4242
}
43+
44+
terraform {
45+
required_providers {
46+
oci = {
47+
source = "oracle/oci"
48+
version = ">= 5.30.0"
49+
}
50+
}
51+
required_version = ">= 1.5.5"
52+
}

0 commit comments

Comments
 (0)