Skip to content

Commit c91eb12

Browse files
kohashimalexng-canuck
authored andcommitted
Add simple instructions to enable instance principal authorization
1 parent e364044 commit c91eb12

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

docs/Writing Terraform configurations for OCI.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,27 @@ provider "oci" {
4343
}
4444
```
4545

46-
Use the region parameter in your provider definition to specify which region
46+
Use the 'region' attribute in your provider definition to specify which region
4747
your resources will be created in. See the [ad_multi_region](https://github.com/oracle/terraform-provider-oci/tree/master/docs/examples/iam/ad_multi_region/ad_multi_region.tf)
4848
or [vcn_multi_region](https://github.com/oracle/terraform-provider-oci/tree/master/docs/examples/networking/vcn_multi_region)
4949
examples for details on how to target multiple regions from one plan.
5050

51+
### Enabling Instance Principal Authorization
52+
To enable instance principal authorization, you can set 'auth' attribute to "InstancePrincipal"
53+
in the provider definition as follows ('tenancy_ocid', 'user_ocid', 'fingerprint'
54+
and 'private_key_path' are not necessary):
55+
```
56+
variable "region" {}
57+
58+
provider "oci" {
59+
auth = "InstancePrincipal"
60+
region = "${var.region}"
61+
}
62+
```
63+
64+
See [Calling Services from an instance](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Tasks/callingservicesfrominstances.htm)
65+
for setting up and using instances as principals.
66+
5167
## OCI resource and data source details
5268
A list of all supported OCI resources and data sources can be found in the [Table of Contents](https://github.com/oracle/terraform-provider-oci/blob/master/docs/Table%20of%20Contents.md).
5369

0 commit comments

Comments
 (0)