Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Copyright 2026 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
name: CloudExadataInfrastructureExascaleConfig
description: |
A resource to configure Exascale storage on an Oracle Cloud Exadata Infrastructure.
self_link: '{{cloud_exadata_infrastructure}}'
id_format: '{{cloud_exadata_infrastructure}}'
import_format:
- 'projects/{{project}}/locations/{{location}}/cloudExadataInfrastructures/{{cloud_exadata_infrastructure}}'
create_url: '{{cloud_exadata_infrastructure}}:configureExascale'
create_verb: POST
immutable: true

autogen_async: true
async:
actions: ['create']
type: OpAsync
operation:
base_url: '{{op_id}}'
include_project: true

custom_code:
custom_delete: templates/terraform/custom_delete/only_remove_from_state.go.tmpl
decoder: templates/terraform/decoders/oracledatabase_cloud_exadata_infrastructure_exascale_config.go.tmpl
custom_import: templates/terraform/custom_import/oracledatabase_cloud_exadata_infrastructure_exascale_config.go.tmpl

examples:
- name: oracledatabase_cloud_exadata_infrastructure_exascale_config_basic
primary_resource_id: "my_exascale_config"
vars:
project: "my-project"
cloud_exadata_infrastructure_id: "my-infra"
deletion_protection: true
ignore_read_extra:
- "deletion_protection"
test_vars_overrides:
"deletion_protection": "false"
"project": '"oci-terraform-testing-prod"'
cloud_exadata_infrastructure_id: 'fmt.Sprintf("ofake-test-tf-configured-exadata-%s", acctest.RandString(t, 10))'

parameters:
- name: project
type: String
required: true
immutable: true
url_param_only: true
- name: location
type: String
required: true
immutable: true
url_param_only: true
- name: cloudExadataInfrastructure
type: ResourceRef
required: true
immutable: true
url_param_only: true
resource: CloudExadataInfrastructure
imports: name

properties:
- name: totalStorageSizeGb
type: Integer
required: true
immutable: true
description: "The total storage to be allocated to Exascale in GBs."
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
config := meta.(*transport_tpg.Config)

// Parse the import ID into project, location and the short name of the exadata infrastructure
if err := tpgresource.ParseImportId([]string{
"projects/(?P<project>[^/]+)/locations/(?P<location>[^/]+)/cloudExadataInfrastructures/(?P<cloud_exadata_infrastructure>[^/]+)",
}, d, config); err != nil {
return nil, err
}

// Construct the full path and set it back on cloud_exadata_infrastructure
project := d.Get("project").(string)
location := d.Get("location").(string)
infraShort := d.Get("cloud_exadata_infrastructure").(string)

infraLong := fmt.Sprintf("projects/%s/locations/%s/cloudExadataInfrastructures/%s", project, location, infraShort)
if err := d.Set("cloud_exadata_infrastructure", infraLong); err != nil {
return nil, fmt.Errorf("Error setting cloud_exadata_infrastructure: %s", err)
}

d.SetId(infraLong)

return []*schema.ResourceData{d}, nil
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
properties, ok := res["properties"].(map[string]interface{})
if !ok || properties == nil {
return nil, fmt.Errorf("properties not found in response")
}

exascaleConfig, ok := properties["exascaleConfig"].(map[string]interface{})
if !ok || exascaleConfig == nil {
return nil, nil
}

res["totalStorageSizeGb"] = exascaleConfig["totalStorageSizeGb"]

return res, nil
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
resource "google_oracle_database_cloud_exadata_infrastructure" "infra" {
cloud_exadata_infrastructure_id = "{{index $.Vars "cloud_exadata_infrastructure_id"}}"
display_name = "{{index $.Vars "cloud_exadata_infrastructure_id"}} displayname"
location = "us-east4"
project = "{{index $.Vars "project"}}"

properties {
shape = "Exadata.X9M"
compute_count = "2"
storage_count = "3"
}

deletion_protection = "{{index $.Vars "deletion_protection"}}"
}

resource "google_oracle_database_cloud_exadata_infrastructure_exascale_config" "{{$.PrimaryResourceId}}" {
cloud_exadata_infrastructure = google_oracle_database_cloud_exadata_infrastructure.infra.name
location = "us-east4"
project = "{{index $.Vars "project"}}"
total_storage_size_gb = 10240
}
Loading