Wait for OCI CLI and Fn CLI to be installed
You need to provide details on the OCI tenancy you will work in and the OCI user you will work as. Please edit these two files:
Paste the contents provided by the workshop instructor into these two files.
Set the environment variable LAB_ID to the number provided to you by the workshop instructor.
Do not continue until you see the file
/root/allSetInBackground appear. If it appears, then the OCI CLI has been installed and you can continue.
Try out the following command to get a list of all namespaces you currently have access to - based on the OCI Configuration defined above.
oci os ns get
If you get a proper response, the OCI is configured correctly and you can proceed. If you run into an error, ask for help from your instructor.
Prepare a number of environment variables. Note: the assumptions here are a compartment called lab-compartment and an API Gateway lab-apigw in that same compartment. We need to get references to these resources in order to create new resources in the right place.
cs=$(oci iam compartment list) export compartmentId=$(echo $cs | jq -r --arg display_name "lab-compartment" '.data | map(select(."name" == $display_name)) | . | .id') apigws=$(oci api-gateway gateway list -c $compartmentId) export apiGatewayId=$(echo $apigws | jq -r --arg display_name "lab-apigw" '.data.items | map(select(."display-name" == $display_name)) | . | .id')
And now we are finally ready to create an API Deployment on API Gateway on Oracle Cloud Infrastructure.