[ Part 3 ] Setup OCI CLI Configuration

In Part 3 we will setup OCI CLI Configuration on the newly deployed instance, "mysqlshellinstance"

Steps to be implemented

  • Gather necessary data (Tenancy OCID & User OCID)

  • Generate PEM keys

  • Add API RSA public key to OCI User from OCI UI

  • Setup configuration file for OCI CLI

  • Test OCI CLI

You will need to configure OCI CLI (along with .pem keys) on mysqlshellinstance host in order to perform data transfer to Object Storage.

[1 ] Gather necessary data (Tenancy OCID & User OCID)

From Cloud-Shell, run the following commands for finding out your Tenancy OCID and User OCID.

You will need to save these details (in a notepad, etc), since they are needed for step 4.

[ 1.1] Tenancy OCID (saved as an environment variable):

Check if the environment variable has been saved:

[ 1.2 ] User OCID

a) Extract your username

---

b) Extract 2 fields (fields1 and fields2) - these are your user's Email and your Name.

---

---

c) Extract User OCID

[ 2 ] Generate PEM Keys

Following steps to be implemented on the "mysqlshellinstance"

[ 2.1 ] Log in to newly deployed instance, "mysqlshellinstance" (your IP will be different)

[ 2.2 ] Download script install.sh and perfom configuration:

[ 2.3 ] Generate PEM keys and fingerprint:

This step will be implemented with the help of generate_pemkeys.sh script.

Make it executable, and run it:

[ 2.4 ] Check if files were created under /root/.oci

[ 3 ] Add API RSA public key to OCI User from OCI UI

The API RSA public key:

[ 3.1 ] Copy the content of oci_api_key_public.pem and go to OCI UI > Menu > Identity > Users:

[ 3.2 ] Select your User, and go down the page.

Select API Keys > Add API Keys, and then paste the content. Click "Add" to apply changes:

[ 4 ] Setup configuration file for OCI CLI

At this step, you must provide the Tenancy OCID and User OCID you saved at step 1.

[ 4.1 ] Setup configuration file for OCI by running the following command:

Running this command will require from you to provide:

  • a location for your config - you will keep here the default:

  • your User OCID

  • your Tenancy OCID

  • your region by index or name - my account is located in eu-frankfurt-1, so I will go with index 13

  • you will be asked if you want to generate a new API Signing RSA key pair -- choose "n" (no)

  • provide the location of your API Signing private key file - here you provide following path:

Possible output:

[ 4.2 ] Check if config file was created under /root/.oci/ folder:

[ 4.3 ] Call OCI CLI tool without full path:

[ 5 ] Test OCI CLI

Let's find out the namespace of our Object storage:

Last updated