hashicorp / hashicorp/packer-plugin-oracle
Authentication to use BOTH config file and OCI CLI Environment Variables
- Dominant language
- Go
- Stars
- 14
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
Please search the existing issues for relevant feature requests, and use the
reaction feature
(https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)
to add upvotes to pre-existing requests.
#### Community Note
Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.
#### Description
Please add feature to allow packer oracle-oci plugin to user both ~/.oci/config AND OCI CLI environment variables in combinations as authentication just like for OCI CLI as documented here: https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/clienvironmentvariables.htm. Currently the oracle-oci plugin only allows ~/.oci/config which is not flexible enough.
#### Use Case(s)
For example, if we want to change region on the fly, the workaround is to append the "region" line in the ~/.oci/config file which is not friendly while environment variables is a great complement in this case. As per Oracle documentation above, OCI CLI does allow the use of config file and environment variables in combinations which would be a great addition to packer oracle-oci plugin.
another example is the key file name. in config file, it has to be one unique hard-coded file path and name which is hard to use as a shared script among different teams/people who would have different file paths and names.
in ~/.oci/config, if only any of the 6 settings are missing, plugin will pickup the missing info from OCI CLI environment variables before error out.
#### Potential configuration
in ~/.oci/config
```
user = ocid1.user.oc1..
fingerprint = 73:5b:df:01:0e:xx:xx
key_file = ~/.oci/api_key.pem
```
in environment variables:
OCI_CLI_REGION=ca-toronto-1
OCI_CLI_PASSPHRASE=password
OCI_CLI_TENANCY=ocid1.tenancy.oc1..aaaaaaaaaaaadfadfasdf
#### Potential References
oci cli fixed this issue a while ago and now support this use case. https://github.com/oracle/oci-cli/issues/586
Contributor guide
Assessment
This issue has not been assessed yet.