You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/guides/best_practices.html.markdown
+2-125Lines changed: 2 additions & 125 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,129 +6,6 @@ description: |-
6
6
The Oracle Cloud Infrastructure provider. Best Practices
7
7
---
8
8
9
-
## Terraform Provider Best Practices
9
+
## Best Practices
10
10
11
-
Following are recommended best practices for writing configurations for the Oracle Cloud Infrastructure Terraform provider.
12
-
13
-
### Sensitive Data May Be Stored In Statefile
14
-
15
-
> **Warning**: The state contains all resource attributes that are specified as part of configuration files. If you manage any sensitive data with Terraform (like database or user passwords, instance or load balancer private keys, etc), treat the state itself as sensitive data.
16
-
Please refer to [Sensitive Data in State](https://www.terraform.io/docs/state/sensitive-data.html) for more details.
17
-
18
-
19
-
### Referencing Images
20
-
21
-
When launching Compute instances, your Terraform configuration should use the same image every time you execute a Terraform Apply command.
22
-
23
-
To ensure this, specify the image OCID directly, rather than locating it using the `oci_core_image` data source.
24
-
This is because the `oci_core_image` data source calls into the ListImages API, whose return values can change over
25
-
time as new images are periodically added and older ones deleted. For a list of Oracle-Provided images and their OCIDs,
26
-
see [Oracle-Provided Images](https://docs.cloud.oracle.com/iaas/Content/Compute/References/images.htm).
27
-
For more information, see the write up in this issue: [Results of oci_core_images will change over time for Oracle-provided images](https://github.com/oracle/terraform-provider-oci/issues/352).
28
-
29
-
We recommend the following pattern for specifying an image for a given region:
A Compute instance can use this in the following way:
46
-
47
-
```hcl
48
-
resource "oci_core_instance" "TFInstance" {
49
-
image = var.image_id[var.region]
50
-
...
51
-
}
52
-
```
53
-
54
-
55
-
### Availability Domains
56
-
57
-
With respect to Availability Domains, we caution against the common pattern of iterating over the results of the `oci_identity_availability_domains` data source, as shown here:
58
-
59
-
```hcl
60
-
// Get all availability domains for the region
61
-
data "oci_identity_availability_domains" "ads" {
62
-
compartment_id = var.tenancy_ocid
63
-
}
64
-
65
-
// Then either use it to get a single AD name based on the index:
The recommendation is to explicitly list the Availability Domain names for the regions in your configuration. To do so, use a variable that you have defined as follows:
The advantage of using this method is that it gives you control over your availability domain usage and prevents unexpected changes over time.
114
-
However, this approach is problematic when configurations are shared between tenancies and regions, since availability domain names are tenancy and region-specific.
115
-
116
-
A convenient alternative is to instead set the ad_list value by using the oci_identity_availability_domains data source.
117
-
You should do this in the configuration, then pass them into the resources or modules. This effectively centralizes the list of ADs,
118
-
making it is easy to switch to an explicit list later, should that become necessary.
Copy file name to clipboardExpand all lines: website/docs/guides/boot_volume_troubleshooting_reuse.html.markdown
+1-87Lines changed: 1 addition & 87 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,91 +8,5 @@ description: |-
8
8
9
9
10
10
## OCI Terraform Provider Boot volume reuse and troubleshooting
11
-
This guide details the following scenarios:<br/>
12
-
1. Preserving boot volume when performing instance scaling<br/>
13
-
2. Boot volume troubleshooting and repair
14
-
15
-
To read more about boot volumes, see [Boot Volumes](https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/bootvolumes.htm)
16
-
17
-
18
-
### Preserve boot volume with instance scaling
19
-
20
-
You may want to upscale / downscale instances (change instance shape) while using the same boot volume. When you terminate
21
-
your instance, you can keep the associated boot volume and use it to launch a new instance using a different instance type
22
-
or shape. This approach is useful for scenarios where instance shape cannot be changed as per [this](https://docs.cloud.oracle.com/en-us/iaas/Content/Compute/Tasks/resizinginstances.htm) while resizing instances.
23
-
24
-
To achieve this, you need to detach the boot volume from the running instance. This can be performed by either
25
-
terminating the instance while preserving the boot volume or by stopping the instance and detaching the boot volume,
26
-
27
-
All terraform resources of type `oci_core_instance` have the parameter `preserve_boot_volume` set as true by default.
28
-
This parameter ensures that upon termination of the instance, the attached boot volume is not terminated.
29
-
30
-
```
31
-
resource "oci_core_instance" "TFInstance" {
32
-
...
33
-
state = "STOPPED" // set this state to stop the instance
34
-
preserve_boot_volume = true
35
-
}
36
-
37
-
output "bootVolumeFromInstance" {
38
-
value = [oci_core_instance.TFInstance.boot_volume_id]
39
-
}
40
-
```
41
-
42
-
Once the boot volume is detached, the OCID of the boot volume can be referred as the source of the new instance, as
Copy file name to clipboardExpand all lines: website/docs/guides/changing_timeouts.html.markdown
+1-9Lines changed: 1 addition & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,12 +8,4 @@ description: |-
8
8
9
9
## Timeout errors when waiting for a state change
10
10
11
-
_If the Terraform CLI gives an error message like:_
12
-
13
-
```
14
-
* oci_database_backup.mydb: timeout while waiting for state to become 'ACTIVE' (last state: 'CREATING', timeout: 15m0s)
15
-
```
16
-
17
-
Then the OCI service is indicating that the resource has not yet reached the expected state after polling for some time.
18
-
19
-
You may need to increase the operation timeout for your resource to continue polling for longer. See [Operation Timeouts](https://www.terraform.io/docs/configuration/resources.html#operation-timeouts) for details on how to do this.
11
+
This content is now available at [Troubleshooting](https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformtroubleshooting.htm).
Copy file name to clipboardExpand all lines: website/docs/guides/database_db_system_migration.html.markdown
+1-128Lines changed: 1 addition & 128 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,131 +8,4 @@ description: |-
8
8
9
9
## Database DB System Migration
10
10
11
-
The X8M generation of Exadata hardware introduces a new resource model that replaces the Exadata DB system. The new resource model uses new APIs to provision and manage its resources. The existing DB system APIs for Exadata will be deprecated by Oracle Cloud Infrastructure for all users following written notification and a transition period allowing you to switch to the new API and Console interfaces.
12
-
13
-
If you have existing Exadata DB systems in Oracle Cloud Infrastructure, you can use Terraform to switch them to the new resource model and APIs.
14
-
15
-
### Warning
16
-
Switching an Exadata DB system to the new resource model and APIs cannot be reversed. If you have automation for your system that utilizes the DB system APIs, you may need to update your applications prior to switching.
17
-
18
-
## Switching to the new resource model:
19
-
* Does not impact the DB system's existing Exadata databases or client connections.
20
-
* Does not change the underlying hardware or shape family of your Exadata Cloud Service instance.
21
-
* Will not affect bare metal and virtual DB systems
22
-
23
-
After converting your DB system, you will have two new resources in place of the DB system resource: a cloud Exadata infrastructure resource, and a cloud VM cluster resource.
24
-
25
-
## What to Expect After Switching
26
-
27
-
* Your new cloud Exadata infrastructure resource and cloud VM cluster are created in the same compartment as the DB system they replace
28
-
* Your new cloud Exadata infrastructure resource and cloud VM cluster use the same networking configuration as the DB system they replace
29
-
* After the switch, you cannot perform operations on the old Exadata DB system resource
30
-
* Switching is permanent, and the change cannot be undone
31
-
* X6, X7, X8 and Exadata base systems retain their fixed shapes after the switch, and cannot be expanded
32
-
33
-
## To switch an Exadata DB system to the new Exadata resource model
34
-
35
-
These migration steps use the following example, which shows an existing Exadata Cloud Service instance using the old DB system resource model:
Provisioning the `oci_database_migration` resource creates two new resources: `oci_database_cloud_exadata_infrastructure` and `oci_database_cloud_vm_cluster`.
111
-
112
-
You can get OCIDs of these two resources from the `oci_database_migration` resource:
113
-
```hcl
114
-
output "cloud_exadata_infrastructure_id" {
115
-
value = oci_database_migration.test_migration.cloud_exadata_infrastructure_id
116
-
}
117
-
118
-
output "cloud_vm_cluster_id" {
119
-
value = oci_database_migration.test_migration.cloud_vm_cluster_id
120
-
}
121
-
```
122
-
For the two new resources, you need to create Terraform config:
After switching to the new Exadata resource model, remove the old `oci_database_db_system` config.
135
-
Terraform now manages the two new resources.
136
-
137
-
### Tip
138
-
After the migration, you can use [Resource Discovery](https://registry.terraform.io/providers/hashicorp/oci/latest/docs/guides/resource_discovery) to create a full configuration and state file for importing these two new resources.
11
+
This content is now available at [Database DB System Migration](https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformservicesreference_migrateanexadatadb.htm).
0 commit comments