Skip to content
Merged
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,79 @@
# 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.

~> **Note:** Oracle Database @ Google Cloud does not support deconfiguring Exascale storage on an Exadata Infrastructure.
Deleting this resource from Terraform state will only remove it from Terraform management; it will not delete or reset the Exascale configuration on the actual Exadata Infrastructure.
self_link: projects/{{project}}/locations/{{location}}/cloudExadataInfrastructures/{{cloud_exadata_infrastructure}}
id_format: projects/{{project}}/locations/{{location}}/cloudExadataInfrastructures/{{cloud_exadata_infrastructure}}
import_format:
- 'projects/{{project}}/locations/{{location}}/cloudExadataInfrastructures/{{cloud_exadata_infrastructure}}'
create_url: projects/{{project}}/locations/{{location}}/cloudExadataInfrastructures/{{cloud_exadata_infrastructure}}:configureExascale
create_verb: POST
immutable: true
timeouts:
insert_minutes: 120

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

custom_code:
custom_delete: templates/terraform/custom_delete/only_remove_from_state.go.tmpl

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to "delete" or reset the value to default?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oracle currently doesn't provide functionality to deconfigure exascale storage on an exadata infrastructure. Since the api does not support deletion/reset for Exascale configurations, which is why only_remove_from_state is used.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a note to that effect in the description of the resource? Just to make sure people know that deleting this resource doesn't actually change or remove the exascale config

decoder: templates/terraform/decoders/oracledatabase_cloud_exadata_infrastructure_exascale_config.go.tmpl

samples:
- name: oracledatabase_cloud_exadata_infrastructure_exascale_config_basic
primary_resource_id: my_exascale_config
steps:
- name: oracledatabase_cloud_exadata_infrastructure_exascale_config_basic
resource_id_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: 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,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 $.ResourceIdVars "cloud_exadata_infrastructure_id"}}"
display_name = "{{index $.ResourceIdVars "cloud_exadata_infrastructure_id"}} displayname"
location = "us-east4"
project = "{{index $.ResourceIdVars "project"}}"

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

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

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