Skip to content

Commit 743ff87

Browse files
author
ccushing
committed
Structure website readme to accord with other providers
* synchronize relevant changes with project root readme * slight improvement to root readme setup instructions
1 parent 1486724 commit 743ff87

File tree

2 files changed

+81
-57
lines changed

2 files changed

+81
-57
lines changed

README.md

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ https://www.terraform.io/intro/getting-started/install.html
4949
#### Get the Oracle Cloud Infrastructure Terraform provider
5050
https://github.com/oracle/terraform-provider-oci/releases
5151

52-
Unpack the provider.
52+
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.
5354

5455
##### On Mac or other Linux flavors
5556
Copy the provider to the following location:
@@ -66,26 +67,27 @@ Note: `%APPDATA%` is a system path specific to your Windows version.
6667

6768

6869
### 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:
7371

74-
Here is breakdown of required as well as commonly set configuration values:
7572
- `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).
7775
- `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.
8080

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.
8284

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.
8587

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.
8991
See the [compute single instance example](https://github.com/oracle/terraform-provider-oci/tree/master/docs/examples/compute/instance) for more info.
9092

9193
In your `~/.bash_profile` set these variables
@@ -95,14 +97,18 @@ export TF_VAR_compartment_ocid=<value>
9597
export TF_VAR_user_ocid=<value>
9698
export TF_VAR_fingerprint=<value>
9799
export TF_VAR_private_key_path=<value>
98-
```
100+
```
99101

100-
Once you've set these values open a new terminal or source your profile changes
102+
Once you've set these values, open a new terminal or source your profile changes:
101103
```
102104
$ source ~/.bash_profile
103105
```
104106

105-
#### Windows
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+
106112
```
107113
setx TF_VAR_tenancy_ocid <value>
108114
setx TF_VAR_compartment_ocid <value>
@@ -134,7 +140,7 @@ $ terraform destroy
134140

135141
## Getting help
136142
If you are having trouble getting the OCI Provider working, check the
137-
[troubleshooting doc](https://github.com/oracle/terraform-provider-oci/tree/master/docs/Troubleshooting.md)
143+
[troubleshooting doc](https://github.com/oracle/terraform-provider-oci/tree/master/docs/Troubleshooting.md).
138144

139145
To see known issues or report unexpected behavior go to the
140146
[Github issues](https://github.com/oracle/terraform-provider-oci/issues) page.

website/docs/index.html.markdown

Lines changed: 56 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,86 +8,104 @@ description: |-
88

99
# Oracle Cloud Infrastructure Provider
1010

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.
1212

1313
Use the navigation to the left to read about the available resources.
1414

1515
## Example Usage
1616

1717
```hcl
18-
# Configure the Oracle Cloud Infrastructure provider
18+
# Configure the Oracle Cloud Infrastructure provider with an API Key
1919
provider "oci" {
2020
tenancy_ocid = "${var.tenancy_ocid}"
2121
user_ocid = "${var.user_ocid}"
2222
fingerprint = "${var.fingerprint}"
2323
private_key_path = "${var.private_key_path}"
2424
region = "${var.region}"
2525
}
26-
```
2726
28-
## Argument Reference
27+
# Get a list of Availability Domains
28+
data "oci_identity_availability_domains" "ads" {
29+
compartment_id = "${var.tenancy_ocid}"
30+
}
2931
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+
}
3136
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+
```
3338

34-
* `user_ocid` - A user's unique ID see [Managing Users](https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingusers.htm)
39+
## Authentication
3540

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.
3742

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:
3945

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.
4154

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.
4458

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.
4661

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.
5266

53-
In your `~/.bash_profile` set these variables
67+
In your `~/.bash_profile` set these variables:
5468
```
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>
58-
export TF_VAR_fingerprint=
59-
export TF_VAR_private_key_path=<fully qualified path>
60-
```
61-
62-
Once you've set these values open a new terminal or source your profile changes
69+
export TF_VAR_tenancy_ocid=<value>
70+
export TF_VAR_compartment_ocid=<value>
71+
export TF_VAR_user_ocid=<value>
72+
export TF_VAR_fingerprint=<value>
73+
export TF_VAR_private_key_path=<value>
74+
```
75+
76+
Once you've set these values open a new terminal or source your profile changes:
6377
```
6478
$ source ~/.bash_profile
6579
```
6680

67-
### Windows
81+
##### Windows
82+
83+
Configuring for Windows usage is largely the same, with one notable exception: you can use PuttyGen to create the public
84+
and private key as shown above, however, you will need to convert them from PPK format to PEM format.
85+
6886
```
6987
setx TF_VAR_tenancy_ocid <value>
70-
setx TF_VAR_user_ocid <value>
7188
setx TF_VAR_compartment_ocid <value>
89+
setx TF_VAR_user_ocid <value>
7290
setx TF_VAR_fingerprint <value>
7391
setx TF_VAR_private_key_path <value>
7492
```
7593
The variables won't be set for the current session, exit the terminal and reopen.
7694

77-
## Enabling Instance Principal Authorization
78-
To enable instance principal authorization, you can set 'auth' attribute to "InstancePrincipal"
79-
in the provider definition as follows ('tenancy_ocid', 'user_ocid', 'fingerprint'
80-
and 'private_key_path' are not necessary):
81-
```
82-
variable "region" {}
8395

96+
### Instance Principal Authentication
97+
Instance Principal authentication allows you to run Terraform from an OCI Instance within your Tenancy. To enable Instance
98+
Principal authentication, set the `auth` attribute to "InstancePrincipal" in the provider definition as below:
99+
```
100+
# Configure the Oracle Cloud Infrastructure provider to use Instance Principal based authentication
84101
provider "oci" {
85102
auth = "InstancePrincipal"
86103
region = "${var.region}"
87104
}
88105
```
89106

90-
## Testing
107+
_Note: this configuration will only work when run from an OCI instance. For more information on using Instance
108+
Principals, see [this document](https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/callingservicesfrominstances.htm)._
91109

92-
Credentials must be provided via the environment variables as shown above in order to run
93-
acceptance tests.
110+
## Testing
111+
Credentials must be provided via the environment variables as shown above in order to run acceptance tests.

0 commit comments

Comments
 (0)