Skip to content

Commit 2ee9335

Browse files
committed
Updated version and fixes
Updated to use Spatial Studio image 22.1.1 Added provider alias with home region to create the IAM artifacts there (dynamic group & policies)
1 parent b04b816 commit 2ee9335

File tree

7 files changed

+41
-16
lines changed

7 files changed

+41
-16
lines changed

build-orm/install.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ data "archive_file" "generate_zip" {
66
type = "zip"
77
output_path = (var.save_to != "" ? "${var.save_to}/orm.zip" : "${path.module}/dist/orm.zip")
88
source_dir = "../terraform"
9-
excludes = ["packer",".terraform.lock.hcl","terraform.tfstate", "terraform.tfvars.template", "terraform.tfvars", "provider.tf", ".terraform", "build-orm", "images", "README.md", "terraform.", "terraform.tfstate.backup", "test", "simple", ".git", "README", ".github", ".gitignore", ".DS_Store", "LICENSE","diagram",]
9+
excludes = ["packer",".terraform.lock.hcl","terraform.tfstate", "terraform.tfvars.template", "terraform.tfvars", ".terraform", "build-orm", "images", "README.md", "terraform.", "terraform.tfstate.backup", "test", "simple", ".git", "README", ".github", ".gitignore", ".DS_Store", "LICENSE","diagram",]
1010
}

terraform/compute.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ resource "oci_core_instance" "simple-vm" {
4444
#This random string will be used for the new database's admin and sgtech users
4545
dba_password=random_string.autonomous_database_admin_password.result
4646

47+
is_public = local.is_public_subnet
48+
4749
#required, to distinguish if DB is new or an existing one will be used, set this to false and pass an empty adb_id
4850
#to skip database metadata repository configuration
4951
create_adb_user = true
@@ -60,7 +62,7 @@ resource "oci_core_instance" "simple-vm" {
6062
#required to set max/min connections for studio
6163
is_free_adb = local.is_free_adb
6264

63-
debug_enabled=true
65+
enable_idcs = false
6466

6567
}
6668

terraform/oci_images.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ variable "marketplace_source_images" {
77

88
default = {
99
main_mktpl_image = {
10-
ocid = "ocid1.image.oc1..aaaaaaaadeywf3clwo5kf6xdvyrpfayh66fmuwws3onopvpnodd7wkuh6dna"
10+
ocid = "ocid1.image.oc1..aaaaaaaalb6tbux65qelwpgvb7h5uklfzujeufaerq2qoh2tewlghnp5ie7a"
1111
is_pricing_associated = false
1212
compatible_shapes = ["VM.Standard1.1", "VM.Standard1.16", "VM.Standard1.2", "VM.Standard1.4", "VM.Standard1.8", "VM.Standard2.1", "VM.Standard2.16", "VM.Standard2.2", "VM.Standard2.24", "VM.Standard2.4", "VM.Standard2.8", "VM.Standard.B1.1", "VM.Standard.B1.16", "VM.Standard.B1.2", "VM.Standard.B1.4", "VM.Standard.B1.8", "VM.Standard.E2.1", "VM.Standard.E2.1.Micro", "VM.Standard.E2.2", "VM.Standard.E2.4", "VM.Standard.E2.8", "VM.Standard3.Flex", "VM.Optimized3.Flex", "VM.Standard.E3.Flex", "VM.Standard.E4.Flex"]
1313
}

terraform/policies.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ locals {
55
}
66

77
resource "oci_identity_dynamic_group" "spatial_instance_principal_group" {
8+
provider = oci.home
89
compartment_id = var.tenancy_ocid
910
description = "dynamic group to allow access to resources"
1011
matching_rule = "ALL { ${local.compartment} }"
@@ -30,6 +31,7 @@ locals {
3031
}
3132

3233
resource "oci_identity_policy" "spatial_policy" {
34+
provider = oci.home
3335
compartment_id = var.tenancy_ocid
3436
description = "policy that allows instance principal access to the CLI api from the instance"
3537
name = "${var.service_name}-policy-${random_string.deploy_id.result}"

terraform/provider.tf

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,40 @@
33
*/
44

55
provider "oci" {
6-
tenancy_ocid = var.tenancy_ocid
7-
user_ocid = var.user_ocid
8-
fingerprint = var.fingerprint
9-
private_key_path = var.private_key_path
106
region = var.region
7+
### Enable below variables if running this from local terraform installation
8+
#tenancy_ocid = var.tenancy_ocid
9+
#user_ocid = var.user_ocid
10+
#fingerprint = var.fingerprint
11+
#private_key_path = var.private_key_path
12+
1113
}
1214

13-
# Variables required by the OCI Provider only when running Terraform CLI with standard user based Authentication
14-
variable "user_ocid" {
15-
}
15+
# Enable below variables required by the OCI Provider when running Terraform CLI locally with standard user based Authentication
16+
#variable "user_ocid" {
17+
#}
18+
#variable "fingerprint" {
19+
#}
20+
#variable "private_key_path" {
21+
#}
1622

17-
variable "fingerprint" {
23+
data "oci_identity_tenancy" "tenancy" {
24+
tenancy_id = var.tenancy_ocid
1825
}
1926

20-
variable "private_key_path" {
27+
data "oci_identity_regions" "home-region" {
28+
filter {
29+
name = "key"
30+
values = [data.oci_identity_tenancy.tenancy.home_region_key]
31+
}
2132
}
33+
34+
provider "oci" {
35+
alias = "home"
36+
region = data.oci_identity_regions.home-region.regions[0]["name"]
37+
### Enable below variables if running this from local terraform installation
38+
#tenancy_ocid = var.tenancy_ocid
39+
#user_ocid = var.user_ocid
40+
#fingerprint = var.fingerprint
41+
#private_key_path = var.private_key_path
42+
}

terraform/schema.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ variableGroups:
7575
- admin_pwd
7676
- vcn_strategy_enum
7777
- adb_type_enum
78-
- user_id
78+
- user_ocid
7979
- fingerprint
8080
- private_key_path
8181
- use_marketplace_image
@@ -399,7 +399,7 @@ variables:
399399
description: The compartment in which to create the server compute instances
400400
required: true
401401

402-
user_id:
402+
user_ocid:
403403
type: string
404404

405405
private_key_path:

terraform/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,11 @@ variable "mp_listing_id" {
190190

191191
# Package version Reference
192192
variable "mp_listing_resource_version" {
193-
default = "21.3.4"
193+
default = "22.1.1.1"
194194
}
195195

196196
# Use this variable along the use_marketplace_image to specify either the
197197
# Image artifact ocid to use the latest official marketplace image or your custom image ocid
198198
variable "instance_image_id" {
199-
default = "ocid1.image.oc1..aaaaaaaadeywf3clwo5kf6xdvyrpfayh66fmuwws3onopvpnodd7wkuh6dna"
199+
default = "ocid1.image.oc1..aaaaaaaalb6tbux65qelwpgvb7h5uklfzujeufaerq2qoh2tewlghnp5ie7a"
200200
}

0 commit comments

Comments
 (0)