-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Adding Terraform support for ExadVmCluster Resource #15742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
038ebdd
edf5ede
2c18f51
5c56c60
d955093
a2f05c0
c78fbe6
2fd4428
5a1587d
8215f7f
e408920
48d4f4e
1580158
6a48de5
ac9335a
5e41e06
bd6401e
c650587
2fdde0d
2f9b227
07801fa
9a8dae7
c1302ec
d353ab4
096a898
166a995
a275a8e
53a7757
9d298de
eb4056a
3edebd5
52e1b90
16266b0
a96692b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,354 @@ | ||
| # Copyright 2025 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: ExadbVmCluster | ||
| description: Description | ||
| base_url: projects/{{project}}/locations/{{location}}/exadbVmClusters | ||
| update_mask: true | ||
| self_link: projects/{{project}}/locations/{{location}}/exadbVmClusters/{{exadb_vm_cluster_id}} | ||
| create_url: projects/{{project}}/locations/{{location}}/exadbVmClusters?exadbVmClusterId={{exadb_vm_cluster_id}} | ||
| update_verb: PATCH | ||
| id_format: projects/{{project}}/locations/{{location}}/exadbVmClusters/{{exadb_vm_cluster_id}} | ||
| import_format: | ||
| - projects/{{project}}/locations/{{location}}/exadbVmClusters/{{exadb_vm_cluster_id}} | ||
| examples: | ||
| - name: oracledatabase_exadb_vm_cluster_basic | ||
| primary_resource_id: "my_exadb_vm_cluster" | ||
| vars: | ||
| project: "my-project" | ||
| exadb_vm_cluster_id: "my-instance" | ||
| exascale_db_storage_vault_id: "my-storage-vault" | ||
| odb_network: "projects/my-project/locations/europe-west2/odbNetworks/my-odbnetwork" | ||
| odb_subnet: "projects/my-project/locations/europe-west2/odbNetworks/my-odbnetwork/odbSubnets/my-odbsubnet" | ||
| backup_odb_subnet: "projects/my-project/locations/europe-west2/odbNetworks/my-odbnetwork/odbSubnets/my-backup-odbsubnet" | ||
| deletion_protection: true | ||
| ignore_read_extra: | ||
| - "deletion_protection" | ||
| test_vars_overrides: | ||
| "deletion_protection": "false" | ||
| "project": '"oci-terraform-testing-prod"' | ||
| # ofake- prefix is needed to create a dummy resource for testing purposes only | ||
| # See: https://github.com/hashicorp/terraform-provider-google/issues/19983#issuecomment-2516403770 | ||
| # As a result these resources are not sweepable | ||
| # See: https://github.com/hashicorp/terraform-provider-google/issues/20599 | ||
| exadb_vm_cluster_id: 'fmt.Sprintf("ofake-tf-test-exadb-vm-cluster-basic-%s", acctest.RandString(t, 10))' | ||
| exascale_db_storage_vault_id: 'fmt.Sprintf("ofake-tf-test-storage-vault-basic-%s", acctest.RandString(t, 10))' | ||
| odb_network: '"projects/oci-terraform-testing-prod/locations/europe-west2/odbNetworks/tf-test-permanent-odbnetwork"' | ||
| odb_subnet: '"projects/oci-terraform-testing-prod/locations/europe-west2/odbNetworks/tf-test-permanent-odbnetwork/odbSubnets/tf-test-permanent-client-odbsubnet"' | ||
| backup_odb_subnet: '"projects/oci-terraform-testing-prod/locations/europe-west2/odbNetworks/tf-test-permanent-odbnetwork/odbSubnets/tf-test-permanent-backup-odbsubnet"' | ||
| - name: oracledatabase_exadb_vm_cluster_full | ||
| primary_resource_id: "my_exadb_vm_cluster" | ||
| vars: | ||
| project: "my-project" | ||
| exadb_vm_cluster_id: "my-instance" | ||
| exascale_db_storage_vault_id: "my-storage-vault" | ||
| odb_network: "projects/my-project/locations/europe-west2/odbNetworks/my-odbnetwork" | ||
| odb_subnet: "projects/my-project/locations/europe-west2/odbNetworks/my-odbnetwork/odbSubnets/my-odbsubnet" | ||
| backup_odb_subnet: "projects/my-project/locations/europe-west2/odbNetworks/my-odbnetwork/odbSubnets/my-backup-odbsubnet" | ||
| deletion_protection: true | ||
| ignore_read_extra: | ||
| - "deletion_protection" | ||
| test_vars_overrides: | ||
| "deletion_protection": "false" | ||
| "project": '"oci-terraform-testing-prod"' | ||
| # ofake- prefix is needed to create a dummy resource for testing purposes only | ||
| # See: https://github.com/hashicorp/terraform-provider-google/issues/19983#issuecomment-2516403770 | ||
| # As a result these resources are not sweepable | ||
| # See: https://github.com/hashicorp/terraform-provider-google/issues/20599 | ||
| exadb_vm_cluster_id: 'fmt.Sprintf("ofake-tf-test-exadb-vm-cluster-basic-%s", acctest.RandString(t, 10))' | ||
| exascale_db_storage_vault_id: 'fmt.Sprintf("ofake-tf-test-storage-vault-basic-%s", acctest.RandString(t, 10))' | ||
| odb_network: '"projects/oci-terraform-testing-prod/locations/europe-west2/odbNetworks/tf-test-permanent-odbnetwork"' | ||
| odb_subnet: '"projects/oci-terraform-testing-prod/locations/europe-west2/odbNetworks/tf-test-permanent-odbnetwork/odbSubnets/tf-test-permanent-client-odbsubnet"' | ||
| backup_odb_subnet: '"projects/oci-terraform-testing-prod/locations/europe-west2/odbNetworks/tf-test-permanent-odbnetwork/odbSubnets/tf-test-permanent-backup-odbsubnet"' | ||
| - name: oracledatabase_exadb_vm_cluster_update | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Support for example-driven update tests isn't officially launched yet, but it does exist. You could modify the generated test, as described in https://googlecloudplatform.github.io/magic-modules/test/test/#add-an-update-test, or you could switch over to |
||
| primary_resource_id: "my_exadb_vm_cluster" | ||
| vars: | ||
| project: "my-project" | ||
| exadb_vm_cluster_id: "my-instance" | ||
| exascale_db_storage_vault_id: "my-storage-vault" | ||
| odb_network: "projects/my-project/locations/europe-west2/odbNetworks/my-odbnetwork" | ||
| odb_subnet: "projects/my-project/locations/europe-west2/odbNetworks/my-odbnetwork/odbSubnets/my-odbsubnet" | ||
| backup_odb_subnet: "projects/my-project/locations/europe-west2/odbNetworks/my-odbnetwork/odbSubnets/my-backup-odbsubnet" | ||
| deletion_protection: true | ||
| ignore_read_extra: | ||
| - "deletion_protection" | ||
| test_vars_overrides: | ||
| "deletion_protection": "false" | ||
| "project": '"oci-terraform-testing-prod"' | ||
| # ofake- prefix is needed to create a dummy resource for testing purposes only | ||
| # See: https://github.com/hashicorp/terraform-provider-google/issues/19983#issuecomment-2516403770 | ||
| # As a result these resources are not sweepable | ||
| # See: https://github.com/hashicorp/terraform-provider-google/issues/20599 | ||
| exadb_vm_cluster_id: 'fmt.Sprintf("ofake-tf-test-exadb-vm-cluster-update-%s", acctest.RandString(t, 10))' | ||
| exascale_db_storage_vault_id: 'fmt.Sprintf("ofake-tf-test-storage-vault-update-%s", acctest.RandString(t, 10))' | ||
| odb_network: '"projects/oci-terraform-testing-prod/locations/europe-west2/odbNetworks/tf-test-permanent-odbnetwork"' | ||
| odb_subnet: '"projects/oci-terraform-testing-prod/locations/europe-west2/odbNetworks/tf-test-permanent-odbnetwork/odbSubnets/tf-test-permanent-client-odbsubnet"' | ||
| backup_odb_subnet: '"projects/oci-terraform-testing-prod/locations/europe-west2/odbNetworks/tf-test-permanent-odbnetwork/odbSubnets/tf-test-permanent-backup-odbsubnet"' | ||
| virtual_fields: | ||
| - name: "deletion_protection" | ||
| type: Boolean | ||
| default_value: true | ||
| description: "Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply that would delete the instance will fail." | ||
| autogen_async: true | ||
| async: | ||
| operation: | ||
| timeouts: | ||
| insert_minutes: 120 | ||
| update_minutes: 60 | ||
| delete_minutes: 60 | ||
| base_url: "{{op_id}}" | ||
| actions: | ||
| - create | ||
| - delete | ||
| - update | ||
| type: OpAsync | ||
| result: | ||
| resource_inside_response: true | ||
| include_project: false | ||
| custom_code: | ||
| pre_delete: "templates/terraform/pre_delete/oracledatabase_exadb_vm_cluster.go.tmpl" | ||
| autogen_status: RXhhZGJWbUNsdXN0ZXI= | ||
| parameters: | ||
| - name: location | ||
| type: String | ||
| description: Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. | ||
| immutable: true | ||
| url_param_only: true | ||
| required: true | ||
| - name: exadbVmClusterId | ||
| type: String | ||
| description: |- | ||
| The ID of the ExadbVmCluster to create. This value is | ||
| restricted to (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$) and must be a maximum of | ||
| 63 characters in length. The value must start with a letter and end with a | ||
| letter or a number. | ||
| immutable: true | ||
| url_param_only: true | ||
| required: true | ||
| properties: | ||
| - name: backupOdbSubnet | ||
| type: String | ||
| description: |- | ||
| The name of the backup OdbSubnet associated with the ExadbVmCluster. | ||
| Format: | ||
| projects/{project}/locations/{location}/odbNetworks/{odb_network}/odbSubnets/{odb_subnet} | ||
| immutable: true | ||
| required: true | ||
| - name: createTime | ||
| type: String | ||
| description: The date and time that the ExadbVmCluster was created. | ||
| output: true | ||
| - name: displayName | ||
| type: String | ||
| description: |- | ||
| The display name for the ExadbVmCluster. The name does not have to | ||
| be unique within your project. The name must be 1-255 characters long and | ||
| can only contain alphanumeric characters. | ||
| immutable: true | ||
| required: true | ||
| - name: entitlementId | ||
| type: String | ||
| description: The ID of the subscription entitlement associated with the ExadbVmCluster. | ||
| output: true | ||
| - name: gcpOracleZone | ||
| type: String | ||
| description: |- | ||
| The GCP Oracle zone where Oracle ExadbVmCluster is hosted. | ||
| Example: us-east4-b-r2. | ||
| During creation, the system will pick the zone assigned to the | ||
| ExascaleDbStorageVault. | ||
| output: true | ||
| immutable: true | ||
| - name: labels | ||
| type: KeyValueLabels | ||
| description: The labels or tags associated with the ExadbVmCluster. | ||
| - name: name | ||
| type: String | ||
| description: |- | ||
| Identifier. The name of the ExadbVmCluster resource in the following format: | ||
| projects/{project}/locations/{region}/exadbVmClusters/{exadb_vm_cluster} | ||
| output: true | ||
| - name: odbNetwork | ||
| type: String | ||
| description: |- | ||
| The name of the OdbNetwork associated with the ExadbVmCluster. | ||
| Format: projects/{project}/locations/{location}/odbNetworks/{odb_network} | ||
| It is optional but if specified, this should match the parent ODBNetwork of | ||
| the OdbSubnet. | ||
| immutable: true | ||
| - name: odbSubnet | ||
| type: String | ||
| description: |- | ||
| The name of the OdbSubnet associated with the ExadbVmCluster for IP | ||
| allocation. Format: | ||
| projects/{project}/locations/{location}/odbNetworks/{odb_network}/odbSubnets/{odb_subnet} | ||
| immutable: true | ||
| required: true | ||
| - name: properties | ||
| type: NestedObject | ||
| description: The properties of an ExadbVmCluster. | ||
| required: true | ||
| properties: | ||
| - name: additionalEcpuCountPerNode | ||
| type: Integer | ||
| description: |- | ||
| The number of additional ECPUs per node for an Exadata VM cluster on | ||
| exascale infrastructure. | ||
| immutable: true | ||
| default_from_api: true | ||
| - name: clusterName | ||
| type: String | ||
| description: |- | ||
| The cluster name for Exascale vm cluster. The cluster name must begin with | ||
| an alphabetic character and may contain hyphens(-) but can not contain | ||
| underscores(_). It should be not more than 11 characters and is not case | ||
| sensitive. | ||
| OCI Cluster name. | ||
| immutable: true | ||
| default_from_api: true | ||
| - name: dataCollectionOptions | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TestAccOracleDatabaseExadbVmCluster_oracledatabaseExadbVmClusterBasicExample is failing with a diff on this field. The fields are in the API response but not on the resource. This will need to be fixed in the resource, since users may want to omit these fields. https://googlecloudplatform.github.io/magic-modules/develop/diffs/ covers common cases. If default_value on the subfields works, that would be ideal; otherwise, adding default_from_api to dataCollectionOptions (and probably also to the subfields) could work. |
||
| type: NestedObject | ||
| description: |- | ||
| Data collection options for diagnostics. | ||
| https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/DataCollectionOptions | ||
| properties: | ||
| - name: isDiagnosticsEventsEnabled | ||
| type: Boolean | ||
| description: Indicates whether to enable data collection for diagnostics. | ||
| - name: isHealthMonitoringEnabled | ||
| type: Boolean | ||
| description: Indicates whether to enable health monitoring. | ||
| - name: isIncidentLogsEnabled | ||
| type: Boolean | ||
| description: Indicates whether to enable incident logs and trace collection. | ||
| - name: enabledEcpuCountPerNode | ||
| type: Integer | ||
| description: |- | ||
| The number of ECPUs enabled per node for an exadata vm cluster on | ||
| exascale infrastructure. | ||
| immutable: true | ||
| required: true | ||
| - name: exascaleDbStorageVault | ||
| type: String | ||
| description: |- | ||
| The name of ExascaleDbStorageVault associated with the ExadbVmCluster. | ||
| It can refer to an existing ExascaleDbStorageVault. Or a new one can be | ||
| created during the ExadbVmCluster creation (requires | ||
| storage_vault_properties to be set). | ||
| Format: | ||
| projects/{project}/locations/{location}/exascaleDbStorageVaults/{exascale_db_storage_vault} | ||
| immutable: true | ||
| required: true | ||
| - name: giVersion | ||
| type: String | ||
| description: The Oracle Grid Infrastructure (GI) software version. | ||
| output: true | ||
| - name: gridImageId | ||
| type: String | ||
| description: Grid Infrastructure Version. | ||
| immutable: true | ||
| required: true | ||
| - name: hostname | ||
| type: String | ||
| description: The hostname of the ExadbVmCluster. | ||
| output: true | ||
| - name: hostnamePrefix | ||
| type: String | ||
| description: Prefix for VM cluster host names. | ||
| immutable: true | ||
| required: true | ||
| default_from_api: true | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like TestAccOracleDatabaseExadbVmCluster_oracledatabaseExadbVmClusterBasicExample and TestAccOracleDatabaseExadbVmCluster_oracledatabaseExadbVmClusterFullExample show a permadiff on the hostnamePrefix field. Looking at the API response, it doesn't look like this is returned by the API at all. Since this is a nested field, you'll need a custom flattener: https://googlecloudplatform.github.io/magic-modules/develop/diffs/#ignore_read |
||
| - name: licenseModel | ||
| type: String | ||
| description: |- | ||
| The license type of the ExadbVmCluster. | ||
| Possible values: | ||
| LICENSE_INCLUDED | ||
| BRING_YOUR_OWN_LICENSE | ||
| immutable: true | ||
| default_from_api: true | ||
| - name: lifecycleState | ||
| type: String | ||
| description: |- | ||
| State of the cluster. | ||
| Possible values: | ||
| PROVISIONING | ||
| AVAILABLE | ||
| UPDATING | ||
| TERMINATING | ||
| TERMINATED | ||
| FAILED | ||
| MAINTENANCE_IN_PROGRESS | ||
| output: true | ||
| - name: memorySizeGb | ||
| type: Integer | ||
| description: |- | ||
| Memory per VM (GB) (Read-only): Shows the amount of memory allocated to | ||
| each VM. Memory is calculated based on 2.75 GB per Total ECPUs. | ||
| output: true | ||
| - name: nodeCount | ||
| type: Integer | ||
| description: The number of nodes/VMs in the ExadbVmCluster. | ||
| required: true | ||
| - name: ociUri | ||
| type: String | ||
| description: Deep link to the OCI console to view this resource. | ||
| output: true | ||
| - name: scanListenerPortTcp | ||
| type: Integer | ||
| description: SCAN listener port - TCP | ||
| immutable: true | ||
| default_from_api: true | ||
| - name: shapeAttribute | ||
| type: String | ||
| description: |- | ||
| The shape attribute of the VM cluster. The type of Exascale storage used | ||
| for Exadata VM cluster. The default is SMART_STORAGE which supports Oracle | ||
| Database 23ai and later | ||
| Possible values: | ||
| SMART_STORAGE | ||
| BLOCK_STORAGE | ||
| immutable: true | ||
| required: true | ||
| - name: sshPublicKeys | ||
| type: Array | ||
| description: The SSH public keys for the ExadbVmCluster. | ||
| immutable: true | ||
| required: true | ||
| item_type: | ||
| type: String | ||
| - name: timeZone | ||
| type: NestedObject | ||
| description: |- | ||
| Represents a time zone from the | ||
| [IANA Time Zone Database](https://www.iana.org/time-zones). | ||
| properties: | ||
| - name: id | ||
| type: String | ||
| description: IANA Time Zone Database time zone. For example "America/New_York". | ||
| - name: version | ||
| type: String | ||
| description: IANA Time Zone Database version number. For example "2019a". | ||
| - name: vmFileSystemStorage | ||
| type: NestedObject | ||
| description: The storage allocation for the exadbvmcluster, in gigabytes (GB). | ||
| required: true | ||
| properties: | ||
| - name: sizeInGbsPerNode | ||
| type: Integer | ||
| description: |- | ||
| The storage allocation for the exadbvmcluster per node, in gigabytes (GB). | ||
| This field is used to calculate the total storage allocation for the | ||
| exadbvmcluster. | ||
| required: true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| resource "google_oracle_database_exadb_vm_cluster" "{{$.PrimaryResourceId}}"{ | ||
| exadb_vm_cluster_id = "{{index $.Vars "exadb_vm_cluster_id"}}" | ||
| display_name = "{{index $.Vars "exadb_vm_cluster_id"}} displayname" | ||
| location = "europe-west2" | ||
| project = "{{index $.Vars "project"}}" | ||
| odb_network = "{{index $.Vars "odb_network"}}" | ||
| odb_subnet = "{{index $.Vars "odb_subnet"}}" | ||
| backup_odb_subnet = "{{index $.Vars "backup_odb_subnet"}}" | ||
| labels = { | ||
| "label-one" = "value-one" | ||
| } | ||
| properties { | ||
| ssh_public_keys = ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCz1X2744t+6vRLmE5u6nHi6/QWh8bQDgHmd+OIxRQIGA/IWUtCs2FnaCNZcqvZkaeyjk5v0lTA/n+9jvO42Ipib53athrfVG8gRt8fzPL66C6ZqHq+6zZophhrCdfJh/0G4x9xJh5gdMprlaCR1P8yAaVvhBQSKGc4SiIkyMNBcHJ5YTtMQMTfxaB4G1sHZ6SDAY9a6Cq/zNjDwfPapWLsiP4mRhE5SSjJX6l6EYbkm0JeLQg+AbJiNEPvrvDp1wtTxzlPJtIivthmLMThFxK7+DkrYFuLvN5AHUdo9KTDLvHtDCvV70r8v0gafsrKkM/OE9Jtzoo0e1N/5K/ZdyFRbAkFT4QSF3nwpbmBWLf2Evg//YyEuxnz4CwPqFST2mucnrCCGCVWp1vnHZ0y30nM35njLOmWdRDFy5l27pKUTwLp02y3UYiiZyP7d3/u5pKiN4vC27VuvzprSdJxWoAvluOiDeRh+/oeQDowxoT/Oop8DzB9uJmjktXw8jyMW2+Rpg+ENQqeNgF1OGlEzypaWiRskEFlkpLb4v/s3ZDYkL1oW0Nv/J8LTjTOTEaYt2Udjoe9x2xWiGnQixhdChWuG+MaoWffzUgx1tsVj/DBXijR5DjkPkrA1GA98zd3q8GKEaAdcDenJjHhNYSd4+rE9pIsnYn7fo5X/tFfcQH1XQ== [email protected]"] | ||
| time_zone { | ||
| id = "UTC" | ||
| } | ||
| grid_image_id = "ocid1.dbpatch.oc1.uk-london-1.anwgiljrt5t4sqqa7anvfhtjk3kukfffjqwjyu2fv435wlcw3hzto6iqyngq" | ||
| node_count = 1 | ||
| enabled_ecpu_count_per_node = 8 | ||
| vm_file_system_storage { | ||
| size_in_gbs_per_node = 220 | ||
| } | ||
| exascale_db_storage_vault = google_oracle_database_exascale_db_storage_vault.exascaleDbStorageVaults.id | ||
| hostname_prefix = "hostname6" | ||
| shape_attribute = "SMART_STORAGE" | ||
|
|
||
| } | ||
|
|
||
| deletion_protection = "{{index $.Vars "deletion_protection"}}" | ||
| } | ||
|
|
||
| resource "google_oracle_database_exascale_db_storage_vault" "exascaleDbStorageVaults"{ | ||
| exascale_db_storage_vault_id = "{{index $.Vars "exascale_db_storage_vault_id"}}" | ||
| display_name = "{{index $.Vars "exascale_db_storage_vault_id"}} displayname" | ||
| location = "europe-west2" | ||
| project = "{{index $.Vars "project"}}" | ||
| properties { | ||
| exascale_db_storage_details { | ||
| total_size_gbs = 512 | ||
| } | ||
| } | ||
|
|
||
| deletion_protection = "{{index $.Vars "deletion_protection"}}" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's now possible to specify additional sweepable prefixes for resources - we should clean this up. https://googlecloudplatform.github.io/magic-modules/reference/resource/#sweeper-1