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
For MacOS download the correct `darwin_*.tar.gz` build for your processor architecture. For Windows this will be a
53
+
zip `windows_*.zip`. For other supported linux version find the corresponding file.
53
54
54
55
##### On Mac or other Linux flavors
55
56
Copy the provider to the following location:
@@ -66,26 +67,27 @@ Note: `%APPDATA%` is a system path specific to your Windows version.
66
67
67
68
68
69
### Setup credentials for using OCI
69
-
Every call to OCI infrastructure requires a minimum of four credentials.
70
-
These are `tenancy_ocid`, `user_ocid`, `fingerprint` and `private_key_path`. It is common to export these values as
71
-
environment variables, or source them in different bash profiles when executing Terraform commands. See the next
72
-
section for OS specific instructions on configuring these environment values.
70
+
Calls to OCI using API key authentication requires that you provide credentials. The following list shows required credentials, as well as common configuration values:
73
71
74
-
Here is breakdown of required as well as commonly set configuration values:
75
72
-`tenancy_ocid` - The global identifier for your account, always shown on the bottom of the web console.
76
-
-`user_ocid` - The identifier of the user account you will be using Terraform with.
73
+
-`user_ocid` - The identifier of the user account you will be using for Terraform. For information on setting the
74
+
correct policies for your user see [Managing Users](https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingusers.htm).
77
75
-`private_key_path` - The path to the private key stored on your computer. The public key portion must be added to the
78
-
user account above in the _API Keys_ section of the web console.
79
-
-`fingerprint` - The fingerprint of the public key added in the above user's _API Keys_ section of the web console.
76
+
user account above in the _API Keys_ section of the web console. For details on how to create and configure keys see
77
+
[Required Keys and OCIDs](https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm).
78
+
-`fingerprint` - The fingerprint of the public key added in the above user's _API Keys_ section of the web console.
79
+
-`region` - The region to target with this provider configuration.
80
80
81
-
For details on how to create and configure keys see [Required Keys and OCIDs](https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm).
81
+
#### Environment variables
82
+
It is common to export the above values as environment variables, or source them in different bash profiles when executing
83
+
Terraform commands. Below are OS specific examples for configuring these environment values.
82
84
83
-
If you primarily work in a single compartment consider defining a `compartment_ocid`as well. The tenancy OCID is also
84
-
the OCID of the root compartment, so that can be used where resources expect a `compartment_id` or `compartment_ocid`.
85
+
If you primarily work in a single compartment, consider exporting the compartment OCID as well. Remember that the
86
+
tenancy OCID is also the OCID of the root compartment, and can be used where any compartment id is required.
85
87
86
-
#### \*nix
87
-
If your Terraform configurations are limited to a single compartment or user then using this `bash_profile` option
88
-
will work well. For more complex environments you may want to maintain multiple sets of environment variables.
88
+
#####\*nix
89
+
If your Terraform configurations are limited to a single compartment or user, then using this `bash_profile` option
90
+
be sufficient. For more complex environments, you may want to maintain multiple sets of environment variables.
89
91
See the [compute single instance example](https://github.com/oracle/terraform-provider-oci/tree/master/docs/examples/compute/instance) for more info.
Copy file name to clipboardExpand all lines: website/docs/index.html.markdown
+56-38Lines changed: 56 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,86 +8,104 @@ description: |-
8
8
9
9
# Oracle Cloud Infrastructure Provider
10
10
11
-
The Oracle Cloud Infrastructure provider is used to interact with the many resources supported by the [Oracle Cloud Infrastructure](https://cloud.oracle.com/cloud-infrastructure).
11
+
The Oracle Cloud Infrastructure provider is used to interact with the many resources supported by the [Oracle Cloud Infrastructure](https://cloud.oracle.com/cloud-infrastructure). The provider needs to be configured with credentials for the Oracle Cloud Infrastructure account.
12
12
13
13
Use the navigation to the left to read about the available resources.
14
14
15
15
## Example Usage
16
16
17
17
```hcl
18
-
# Configure the Oracle Cloud Infrastructure provider
18
+
# Configure the Oracle Cloud Infrastructure provider with an API Key
19
19
provider "oci" {
20
20
tenancy_ocid = "${var.tenancy_ocid}"
21
21
user_ocid = "${var.user_ocid}"
22
22
fingerprint = "${var.fingerprint}"
23
23
private_key_path = "${var.private_key_path}"
24
24
region = "${var.region}"
25
25
}
26
-
```
27
26
28
-
## Argument Reference
27
+
# Get a list of Availability Domains
28
+
data "oci_identity_availability_domains" "ads" {
29
+
compartment_id = "${var.tenancy_ocid}"
30
+
}
29
31
30
-
The following arguments are supported:
32
+
# Output the result
33
+
output "show-ads" {
34
+
value = "${data.oci_identity_availability_domains.ads.availability_domains}"
35
+
}
31
36
32
-
*`tenancy_ocid` - Every Oracle Cloud Infrastructure resource has an Oracle-assigned unique ID called an Oracle Cloud Identifier (OCID). You need your tenancy's OCID to use the API. You'll also need it when contacting support.
37
+
```
33
38
34
-
*`user_ocid` - A user's unique ID see [Managing Users](https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingusers.htm)
39
+
## Authentication
35
40
36
-
*`fingerprint` - You specify the key's fingerprint to indicate which key you're using to sign the request.
41
+
The OCI provider supports API Key based authentication and Instance Principal based authentication.
37
42
38
-
*`private_key_path` - The path to the private key file
43
+
### API Key based authentication
44
+
Calls to OCI using API Key authentication requires that you provide the following credentials:
39
45
40
-
*`region` - A region is composed of several availability domains. Oracle Cloud Infrastructure resources are either region-specific, such as a virtual cloud network, or availability domain-specific, such as a compute instance.
46
+
-`tenancy_ocid` - The global identifier for your account, always shown on the bottom of the web console.
47
+
-`user_ocid` - The identifier of the user account you will be using for Terraform. For information on setting the
48
+
correct policies for your user see [Managing Users](https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingusers.htm).
49
+
-`private_key_path` - The path to the private key stored on your computer. The public key portion must be added to the
50
+
user account above in the _API Keys_ section of the web console. For details on how to create and configure keys see
51
+
[Required Keys and OCIDs](https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm).
52
+
-`fingerprint` - The fingerprint of the public key added in the above user's _API Keys_ section of the web console.
53
+
-`region` - The region to target with this provider configuration.
41
54
42
-
## Export credentials
43
-
Required Keys and OCIDs - https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm
55
+
#### Environment variables
56
+
It is common to export the above values as environment variables, or source them in different bash profiles when executing
57
+
Terraform commands. Below are OS specific examples for configuring these environment values.
44
58
45
-
If you primarily work in a single compartment consider exporting that compartment's OCID as well. Remember that the tenancy OCID is also the OCID of the root compartment.
59
+
If you primarily work in a single compartment, consider exporting the compartment OCID as well. The tenancy OCID is also
60
+
the OCID of the root compartment, and can be used where any compartment id is required.
46
61
47
-
### \*nix
48
-
If your TF configurations are limited to a single compartment/user then
49
-
using this `bash_profile` option will work well. For more complex
50
-
environments you may want to maintain multiple sets of environment
51
-
variables.
62
+
##### \*nix
63
+
If your Terraform configurations are limited to a single compartment or user, then using this `bash_profile` option be
64
+
sufficient. For more complex environments you may want to maintain multiple sets of environment variables.
65
+
See the [compute single instance example](https://github.com/oracle/terraform-provider-oci/tree/master/docs/examples/compute/instance) for more info.
52
66
53
-
In your `~/.bash_profile` set these variables
67
+
In your `~/.bash_profile` set these variables:
54
68
```
55
-
export TF_VAR_tenancy_ocid=
56
-
export TF_VAR_user_ocid=
57
-
export TF_VAR_compartment_ocid=<The tenancy OCID can be used as the compartment OCID of your root compartment>
0 commit comments