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/index.html.markdown
+1-171Lines changed: 1 addition & 171 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,174 +27,4 @@ As you write your configuration files, use the left navigation panel on this pag
27
27
28
28
The Oracle Cloud Infrastructure [Resource Manager](https://docs.oracle.com/en-us/iaas/Content/ResourceManager/Concepts/landing.htm#ResourceManager) is an Oracle-managed service that is based on Terraform and uses Terraform configuration files to automate deployment and operations for the OCI resources supported by the OCI Terraform provider.
29
29
30
-
Resource Manager allows you to share and manage infrastructure configurations and state files across multiple teams and platforms. This infrastructure management can't be done with local Terraform installations and Oracle Terraform modules alone. See the [Overview of Resource Manager](https://docs.oracle.com/en-us/iaas/Content/ResourceManager/Concepts/resourcemanager.htm) for more information.
31
-
## Example Usage
32
-
33
-
```hcl
34
-
# Configure the Oracle Cloud Infrastructure provider with an API Key
35
-
provider "oci" {
36
-
tenancy_ocid = var.tenancy_ocid
37
-
user_ocid = var.user_ocid
38
-
fingerprint = var.fingerprint
39
-
private_key_path = var.private_key_path
40
-
region = var.region
41
-
}
42
-
43
-
# Get a list of Availability Domains
44
-
data "oci_identity_availability_domains" "ads" {
45
-
compartment_id = var.tenancy_ocid
46
-
}
47
-
48
-
# Output the result
49
-
output "show-ads" {
50
-
value = data.oci_identity_availability_domains.ads.availability_domains
51
-
}
52
-
53
-
```
54
-
More Oracle Cloud Infrastructure provider examples can be found [here](https://github.com/terraform-providers/terraform-provider-oci/tree/master/examples).
55
-
56
-
## Sensitive Data May Be Stored In Statefile
57
-
58
-
> **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.
59
-
Please refer to [Sensitive Data in State](https://www.terraform.io/docs/state/sensitive-data.html) for more details.
60
-
61
-
62
-
## Authentication
63
-
64
-
The OCI provider supports API Key based authentication, Instance Principal based authentication and Security Token authentication.
65
-
66
-
### API Key based authentication
67
-
Calls to OCI using API Key authentication requires that you provide the following credentials:
68
-
69
-
-`tenancy_ocid` - OCID of your tenancy. To get the value, see [Required Keys and OCIDs #Tenancy's OCID](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/apisigningkey.htm#five).
70
-
-`user_ocid` - OCID of the user calling the API. To get the value, see [Required Keys and OCIDs #User's OCID](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/apisigningkey.htm#five).
71
-
-`private_key` - The contents of the private key file, required if `private_key_path` is not defined, takes precedence over `private_key_path` if both are defined.
72
-
For details on how to create and configure keys see [Required Keys and OCIDs #How to Upload the Public Key](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/apisigningkey.htm#three).
73
-
-`private_key_path` - The path (including filename) of the private key stored on your computer, required if `private_key` is not defined.
74
-
For details on how to create and configure keys see [Required Keys and OCIDs #How to Upload the Public Key](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/apisigningkey.htm#three).
75
-
-`private_key_password` - (Optional) Passphrase used for the key, if it is encrypted.
76
-
-`fingerprint` - Fingerprint for the key pair being used. To get the value, see [Required Keys and OCIDs #How to Get the Key's Fingerprint](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/apisigningkey.htm#four).
77
-
-`region` - An Oracle Cloud Infrastructure region. See [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm).
78
-
-`config_file_profile` - Profile Name if you would like to use custom profile for oci standard config file for credentials
79
-
80
-
#### Environment variables
81
-
It is common to export the above values as environment variables, or source them in different bash profiles when executing
82
-
Terraform commands. Below are OS specific examples for configuring these environment values.
83
-
84
-
If you primarily work in a single compartment, consider exporting the compartment OCID as well. The tenancy OCID is also
85
-
the OCID of the root compartment, and can be used where any compartment id is required.
86
-
87
-
##### \*nix
88
-
If your Terraform configurations are limited to a single compartment or user, then using this `bash_profile` option be
89
-
sufficient. For more complex environments you may want to maintain multiple sets of environment variables.
90
-
See the [compute single instance example](https://github.com/oracle/terraform-provider-oci/tree/master/examples/compute/instance) for more info.
91
-
92
-
In your `~/.bash_profile` set these variables:
93
-
94
-
```
95
-
export TF_VAR_tenancy_ocid=<value>
96
-
export TF_VAR_compartment_ocid=<value>
97
-
export TF_VAR_user_ocid=<value>
98
-
export TF_VAR_fingerprint=<value>
99
-
export TF_VAR_private_key_path=<value>
100
-
```
101
-
102
-
Once you've set these values open a new terminal or source your profile changes:
103
-
```
104
-
$ source ~/.bash_profile
105
-
```
106
-
107
-
##### Windows
108
-
109
-
Configuring for Windows usage is largely the same, with one notable exception: you can use PuttyGen to create the public
110
-
and private key as shown above, however, you will need to convert them from PPK format to PEM format.
111
-
112
-
```
113
-
setx TF_VAR_tenancy_ocid <value>
114
-
setx TF_VAR_compartment_ocid <value>
115
-
setx TF_VAR_user_ocid <value>
116
-
setx TF_VAR_fingerprint <value>
117
-
setx TF_VAR_private_key_path <value>
118
-
```
119
-
The variables won't be set for the current session, exit the terminal and reopen.
120
-
121
-
#### Using the SDK and CLI Configuration File
122
-
It is possible to define the required provider values in the same `~/.oci/config` file that the SDKs and CLI support.
123
-
For details on setting up this configuration see [SDK and CLI Configuration File](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/sdkconfig.htm).
124
-
125
-
_Note: the parameter names are slightly different. Provider block from terraform config can be completely removed if all API Key based authentication required values are provided as environment variables, in a `*.tfvars file` or `~/.oci/config`_. When using empty provider block, `private_key_password` if required should to be set in `~/.oci/config`.
126
-
127
-
If the parameters have multiple sources, the priority is going to be: 1 environment value, 2 non-default profile if provided, 3 DEFAULT profile
128
-
129
-
TO used non-default profile, you can set it through environment value like: `export TF_VAR_config_file_profile=<value>` or set it in a provider block like:
130
-
131
-
```
132
-
provider "oci" {
133
-
tenancy_ocid = var.tenancy_ocid
134
-
config_file_profile= var.config_file_profile
135
-
}
136
-
```
137
-
138
-
### Instance Principal Authentication
139
-
Instance Principal authentication allows you to run Terraform from an OCI Instance within your Tenancy. To enable Instance
140
-
Principal authentication, set the `auth` attribute to "InstancePrincipal" in the provider definition as below:
141
-
142
-
```
143
-
# Configure the Oracle Cloud Infrastructure provider to use Instance Principal based authentication
144
-
provider "oci" {
145
-
auth = "InstancePrincipal"
146
-
region = var.region
147
-
}
148
-
```
149
-
150
-
_Note: this configuration will only work when run from an OCI instance. For more information on using Instance
151
-
Principals, see [this document](https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/callingservicesfrominstances.htm)._
152
-
153
-
Most of the OCI resources need `compartment_id` i.e. the OCID of the parent compartment as a mandatory input argument for provisioning resource in that compartment. Compartment OCID of the instance can be obtained from the [instance metadata](https://docs.cloud.oracle.com/en-us/iaas/Content/Compute/Tasks/gettingmetadata.htm) endpoint as shown below:
Security Token authentication allows you to run Terraform using a token generated with [Token-based Authentication for the CLI](https://docs.cloud.oracle.com/en-us/iaas/Content/API/SDKDocs/clitoken.htm).
171
-
To enable Security Token authentication, set the `auth` attribute to "SecurityToken" and provide a value for `config_file_profile` in the provider definition. For example:
172
-
173
-
```
174
-
# Configure the Oracle Cloud Infrastructure provider to use Security Token authentication
175
-
provider "oci" {
176
-
auth = "SecurityToken"
177
-
config_file_profile = "PROFILE"
178
-
}
179
-
```
180
-
181
-
_Note: This token expires after 1 hour. Avoid using this authentication when provisioning of resources takes longer than 1 hour.
182
-
To refresh the security token, see [this document](https://docs.cloud.oracle.com/en-us/iaas/Content/API/SDKDocs/clitoken.htm#RefreshingaToken)._
183
-
184
-
## Configuring Automatic Retries
185
-
While applying, refreshing, or destroying a plan, Terraform may encounter some intermittent OCI errors (such as 429 or 500 errors) that could succeed on retry.
186
-
By default, the Terraform OCI provider will automatically retry such operations for up to 10 minutes.
187
-
The following fields can be specified in the provider block to further configure the retry behavior:
188
-
189
-
-`disable_auto_retries` - Disable automatic retries for retriable errors.
190
-
-`retry_duration_seconds` - The minimum duration (in seconds) to retry a resource operation in response to HTTP 429 and HTTP 500 errors. The actual retry duration may be slightly longer due to jittering of retry operations. This value is ignored if the `disable_auto_retries` field is set to true.
191
-
192
-
### Concurrency Control using Retry Backoff and Jitter
193
-
To alleviate contention between parallel operations against OCI services; the Terraform OCI provider schedules retry attempts using quadratic backoff and full jitter.
194
-
Quadratic backoff increases the maximum interval between subsequent retry attempts, while full jitter randomly selects a retry interval within the backoff range.
195
-
196
-
For example, the wait time between the 1st and 2nd retry attempts is chosen randomly between 1 and 8 seconds. The wait time between the 2nd and 3rd retry attempts is chosen
197
-
randomly between 1 and 18 seconds. Regardless of the number of retry attempts, the retry interval time is capped after the 12th attempt at 288 seconds.
198
-
199
-
Note that the `retry_duration_seconds` field only affects retry duration in response to HTTP 429 and 500 errors; as these errors are more likely to result in success after a long retry duration.
200
-
Other HTTP errors (such as 400, 401, 403, 404, and 409) are unlikely to succeed on retry. The `retry_duration_seconds` field does not affect the retry behavior for such errors.
30
+
Resource Manager allows you to share and manage infrastructure configurations and state files across multiple teams and platforms. This infrastructure management can't be done with local Terraform installations and Oracle Terraform modules alone. See the [Overview of Resource Manager](https://docs.oracle.com/en-us/iaas/Content/ResourceManager/Concepts/resourcemanager.htm) for more information.
0 commit comments