Skip to content

Commit 95f6d10

Browse files
Add exascaleDbStorageVault and storageManagementType fields to CloudV… (#18145) (#1362)
[upstream:d3b85a12172e46bb954c94ac14cce9f352089f91] Signed-off-by: Modular Magician <magic-modules@google.com>
1 parent 031fae8 commit 95f6d10

4 files changed

Lines changed: 184 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file has some scaffolding to make sure that names are unique and that
2+
# a region and zone are selected when you try to create your Terraform resources.
3+
4+
locals {
5+
name_suffix = "${random_pet.suffix.id}"
6+
}
7+
8+
resource "random_pet" "suffix" {
9+
length = 2
10+
}
11+
12+
provider "google" {
13+
region = "us-central1"
14+
zone = "us-central1-c"
15+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
resource "google_oracle_database_cloud_vm_cluster" "my_vmcluster" {
2+
cloud_vm_cluster_id = "my-instance-${local.name_suffix}"
3+
display_name = "my-instance-${local.name_suffix} displayname"
4+
location = "us-east4"
5+
project = "my-project-${local.name_suffix}"
6+
exadata_infrastructure = google_oracle_database_cloud_exadata_infrastructure.infra.id
7+
network = data.google_compute_network.default.id
8+
cidr = "10.5.0.0/24"
9+
backup_subnet_cidr = "10.6.0.0/24"
10+
11+
exascale_db_storage_vault = google_oracle_database_exascale_db_storage_vault.vault.name
12+
13+
properties {
14+
license_type = "LICENSE_INCLUDED"
15+
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== nobody@google.com"]
16+
cpu_core_count = "4"
17+
gi_version = "23.0.0.0"
18+
hostname_prefix = "hostname1"
19+
20+
# Required fields for Exascale-based VM Clusters:
21+
memory_size_gb = 60
22+
db_node_storage_size_gb = 120
23+
db_server_ocids = [
24+
data.google_oracle_database_db_servers.db_servers.db_servers.0.properties.0.ocid,
25+
data.google_oracle_database_db_servers.db_servers.db_servers.1.properties.0.ocid
26+
]
27+
}
28+
29+
deletion_protection = "true-${local.name_suffix}"
30+
31+
depends_on = [google_oracle_database_cloud_exadata_infrastructure_exascale_config.exascale_config]
32+
}
33+
34+
resource "google_oracle_database_cloud_exadata_infrastructure" "infra" {
35+
cloud_exadata_infrastructure_id = "my-exadata-${local.name_suffix}"
36+
display_name = "my-exadata-${local.name_suffix} displayname"
37+
location = "us-east4"
38+
project = "my-project-${local.name_suffix}"
39+
properties {
40+
shape = "Exadata.X9M"
41+
compute_count = "2"
42+
storage_count = "3"
43+
}
44+
45+
deletion_protection = "true-${local.name_suffix}"
46+
}
47+
48+
resource "google_oracle_database_cloud_exadata_infrastructure_exascale_config" "exascale_config" {
49+
cloud_exadata_infrastructure = google_oracle_database_cloud_exadata_infrastructure.infra.cloud_exadata_infrastructure_id
50+
location = "us-east4"
51+
project = "my-project-${local.name_suffix}"
52+
total_storage_size_gb = 10240
53+
}
54+
55+
resource "google_oracle_database_exascale_db_storage_vault" "vault" {
56+
exascale_db_storage_vault_id = "my-vault-${local.name_suffix}"
57+
display_name = "my-vault-${local.name_suffix} displayname"
58+
location = "us-east4"
59+
project = "my-project-${local.name_suffix}"
60+
61+
exadata_infrastructure = google_oracle_database_cloud_exadata_infrastructure.infra.name
62+
63+
depends_on = [google_oracle_database_cloud_exadata_infrastructure_exascale_config.exascale_config]
64+
65+
properties {
66+
exascale_db_storage_details {
67+
total_size_gbs = 2048
68+
}
69+
}
70+
71+
deletion_protection = "true-${local.name_suffix}"
72+
}
73+
74+
data "google_compute_network" "default" {
75+
name = "new"
76+
project = "my-project-${local.name_suffix}"
77+
}
78+
79+
data "google_oracle_database_db_servers" "db_servers" {
80+
location = "us-east4"
81+
project = "my-project-${local.name_suffix}"
82+
cloud_exadata_infrastructure = google_oracle_database_cloud_exadata_infrastructure.infra.cloud_exadata_infrastructure_id
83+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
===
2+
3+
These examples use real resources that will be billed to the
4+
Google Cloud Platform project you use - so make sure that you
5+
run "terraform destroy" before quitting!
6+
7+
===
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Oracledatabase Cloud Vmcluster Exascale - Terraform
2+
3+
## Setup
4+
5+
<walkthrough-author name="rileykarson@google.com" analyticsId="UA-125550242-1" tutorialName="oracledatabase_cloud_vmcluster_exascale" repositoryUrl="https://github.com/terraform-google-modules/docs-examples"></walkthrough-author>
6+
7+
Welcome to Terraform in Google Cloud Shell! We need you to let us know what project you'd like to use with Terraform.
8+
9+
<walkthrough-project-billing-setup></walkthrough-project-billing-setup>
10+
11+
Terraform provisions real GCP resources, so anything you create in this session will be billed against this project.
12+
13+
## Terraforming!
14+
15+
Let's use {{project-id}} with Terraform! Click the Cloud Shell icon below to copy the command
16+
to your shell, and then run it from the shell by pressing Enter/Return. Terraform will pick up
17+
the project name from the environment variable.
18+
19+
```bash
20+
export GOOGLE_CLOUD_PROJECT={{project-id}}
21+
```
22+
23+
After that, let's get Terraform started. Run the following to pull in the providers.
24+
25+
```bash
26+
terraform init
27+
```
28+
29+
With the providers downloaded and a project set, you're ready to use Terraform. Go ahead!
30+
31+
```bash
32+
terraform apply
33+
```
34+
35+
Terraform will show you what it plans to do, and prompt you to accept. Type "yes" to accept the plan.
36+
37+
```bash
38+
yes
39+
```
40+
41+
42+
## Post-Apply
43+
44+
### Editing your config
45+
46+
Now you've provisioned your resources in GCP! If you run a "plan", you should see no changes needed.
47+
48+
```bash
49+
terraform plan
50+
```
51+
52+
So let's make a change! Try editing a number, or appending a value to the name in the editor. Then,
53+
run a 'plan' again.
54+
55+
```bash
56+
terraform plan
57+
```
58+
59+
Afterwards you can run an apply, which implicitly does a plan and shows you the intended changes
60+
at the 'yes' prompt.
61+
62+
```bash
63+
terraform apply
64+
```
65+
66+
```bash
67+
yes
68+
```
69+
70+
## Cleanup
71+
72+
Run the following to remove the resources Terraform provisioned:
73+
74+
```bash
75+
terraform destroy
76+
```
77+
```bash
78+
yes
79+
```

0 commit comments

Comments
 (0)