diff --git a/README.md b/README.md index 4adeaa6e..69a54136 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Best practice: Just follow the wizard. (Not tested lately) ## License -Copyright (c) 2022 Oracle and/or its affiliates. +Copyright (c) 2023 Oracle and/or its affiliates. Licensed under the Universal Permissive License (UPL), Version 1.0. diff --git a/basis/src/terraform/datasource.tf b/basis/src/terraform/datasource.tf index 8cc44918..5ef87ea1 100644 --- a/basis/src/terraform/datasource.tf +++ b/basis/src/terraform/datasource.tf @@ -1,4 +1,4 @@ -## Copyright (c) 2022, Oracle and/or its affiliates. +## Copyright (c) 2023, Oracle and/or its affiliates. ## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl data "oci_identity_availability_domains" "ADs" { @@ -81,12 +81,12 @@ output "oracle-dev-linux-latest-name" { } */ -output "oracle-linux-latest-name" { - value = data.oci_core_images.oraclelinux.images.0.display_name +locals { + oracle-linux-latest-name = coalesce( data.oci_core_images.oraclelinux.images.0.display_name, "Oracle-Linux-8.8-2023.10.24-0") } -output "oracle-linux-latest-id" { - value = data.oci_core_images.oraclelinux.images.0.id +output "oracle-linux-latest-name" { + value = local.oracle-linux-latest-name } ## Object Storage @@ -108,6 +108,9 @@ data "oci_identity_compartment" "compartment" { locals { ocir_docker_repository = join("", [lower(lookup(data.oci_identity_regions.current_region.regions[0], "key")), ".ocir.io"]) ocir_namespace = lookup(data.oci_objectstorage_namespace.ns, "namespace") - ocir_username = "${local.ocir_namespace}/${var.username}" + ocir_username = join( "/", [ coalesce(local.ocir_namespace, "missing_privilege"), var.username ]) } +resource "random_id" "tag" { + byte_length = 2 +} \ No newline at end of file diff --git a/coderepo.tf b/coderepo.tf index 1c6dc578..19903212 100644 --- a/coderepo.tf +++ b/coderepo.tf @@ -1,4 +1,4 @@ -## Copyright (c) 2022, Oracle and/or its affiliates. +## Copyright (c) 2023, Oracle and/or its affiliates. ## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl resource "oci_devops_repository" "test_repository" { diff --git a/datasources.tf b/datasources.tf index 3da234f2..af679f3a 100644 --- a/datasources.tf +++ b/datasources.tf @@ -1,4 +1,4 @@ -## Copyright (c) 2022, Oracle and/or its affiliates. +## Copyright (c) 2023, Oracle and/or its affiliates. ## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl ################### Tenancy diff --git a/devops.tf b/devops.tf index 3b775bc4..60c24cb2 100644 --- a/devops.tf +++ b/devops.tf @@ -1,4 +1,4 @@ -## Copyright (c) 2022, Oracle and/or its affiliates. +## Copyright (c) 2023, Oracle and/or its affiliates. ## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl # Create log and log group diff --git a/option/terraform/atp.tf b/option/terraform/atp.tf index fc869712..76b88f4e 100644 --- a/option/terraform/atp.tf +++ b/option/terraform/atp.tf @@ -4,7 +4,8 @@ resource "oci_database_autonomous_database" "starter_atp" { compartment_id = local.lz_database_cmp_ocid cpu_core_count = "1" data_storage_size_in_tbs = "1" - db_name = "${var.prefix}atp" + # Random name to have several OCI Starter ATP named (starteratp-xx) on the same Tenancy (Ex: livelabs) + db_name = "${var.prefix}atp-${random_id.tag.hex}" #Optional db_workload = "OLTP" diff --git a/option/terraform/bastion.tf b/option/terraform/bastion.tf index be7f8af7..c501ee4c 100644 --- a/option/terraform/bastion.tf +++ b/option/terraform/bastion.tf @@ -24,7 +24,7 @@ resource "oci_core_instance" "starter_bastion" { source_details { source_type = "image" - source_id = data.oci_core_images.oraclelinux.images.0.id + source_id = local.oracle-linux-latest-name } connection { diff --git a/option/terraform/compute.tf b/option/terraform/compute.tf index cd381bda..c995369c 100644 --- a/option/terraform/compute.tf +++ b/option/terraform/compute.tf @@ -38,7 +38,7 @@ resource "oci_core_instance" "starter_instance" { source_details { source_type = "image" - source_id = data.oci_core_images.oraclelinux.images.0.id + source_id = local.oracle-linux-latest-name } connection { diff --git a/option/terraform/db_free_compute.tf b/option/terraform/db_free_compute.tf index 47b2a47d..dad10e80 100644 --- a/option/terraform/db_free_compute.tf +++ b/option/terraform/db_free_compute.tf @@ -26,7 +26,7 @@ resource "oci_core_instance" "starter_db_free" { source_details { source_type = "image" - source_id = data.oci_core_images.oraclelinux.images.0.id + source_id = local.oracle-linux-latest-name } /* diff --git a/policies.tf b/policies.tf index 0880a8f8..74835922 100644 --- a/policies.tf +++ b/policies.tf @@ -1,4 +1,4 @@ -## Copyright (c) 2022, Oracle and/or its affiliates. +## Copyright (c) 2023, Oracle and/or its affiliates. ## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl resource "oci_identity_dynamic_group" "devopsgroup1" { diff --git a/provider.tf b/provider.tf index 0008d125..fc20d9ae 100644 --- a/provider.tf +++ b/provider.tf @@ -1,4 +1,4 @@ -## Copyright (c) 2022, Oracle and/or its affiliates. +## Copyright (c) 2023, Oracle and/or its affiliates. ## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl terraform { diff --git a/variables.tf b/variables.tf index 2972c0b9..270c21df 100644 --- a/variables.tf +++ b/variables.tf @@ -1,4 +1,4 @@ -## Copyright (c) 2022, Oracle and/or its affiliates. +## Copyright (c) 2023, Oracle and/or its affiliates. ## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl # Prepopulated variable by Resource Manager