(Many ways) How to upload files into Oracle Cloud Infrastructure - Cloud Shell image 8

(Many ways) How to upload files into Oracle Cloud Infrastructure – Cloud Shell

Oracle Cloud Infrastructure Cloud Shell is VM that runs inside OCI -to be used for manipulating OCI resources using various means, including OCI CLI, Terraform and Ansible. We may want to be able to get files into Cloud Shell – scripts, source code, Infrastructure as Code and more. There are many ways in which we can these files into Cloud Shell. Let me quickly sum up a few that come to mind:

image

  • create a file inside Cloud Shell, open it using an editor such as vi or nano and paste in the contents
  • commit the file to a Git Repo and clone the repo to the Cloud Shell
  • put the file on OCI Object Storage and download said file using OCI CLI: oci os object get -bn <bucket name> –name <object name> –file <download-as-file-name>
  • put the file on OCI Object Storage, create a pre-authenticated request  and use the URL in a curl or wget operation in Cloud Shell to download the file
  • put the file on a public site (Dropbox, OneDrive, Google Drive) and download the file from there
  • put the file in a Docker Container, push the container image to a Container Registry, pull the image into Cloud Shell, start a container and docker cp the files from the container to the Cloud Shell host storage
  • create a REST API (for example using Node) to which files can be uploaded – and will be saved locally by the web application; then use ngrok to create a public endpoint that links up with the REST API and post files to this endpoint. They are forwarded through the ngrok public cloud to the application running locally on Cloud Shell and saved on the Cloud Shell storage

4 Comments

  1. mauritsgroenenberg May 13, 2021
    • Anil Kapuria September 27, 2021
    • Senaka Suriyaarachchi December 8, 2021
      • Lucas Jellema December 8, 2021