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

Lucas Jellema 4
0 0
Read Time:1 Minute, 26 Second

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

About Post Author

Lucas Jellema

Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director and Oracle Developer Champion. Solution architect and developer on diverse areas including SQL, JavaScript, Kubernetes & Docker, Machine Learning, Java, SOA and microservices, events in various shapes and forms and many other things. Author of the Oracle Press book Oracle SOA Suite 12c Handbook. Frequent presenter on user groups and community events and conferences such as JavaOne, Oracle Code, CodeOne, NLJUG JFall and Oracle OpenWorld.
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

4 thoughts on “(Many ways) How to upload files into Oracle Cloud Infrastructure – Cloud Shell

      1. Hi Senaka,
        I checked with my colleague Jeffrey and he shared with me this information:
        If you can login through ssh from cloud shell to your server, then it should be possible to copy a file from the cloud shell file system to the VM over scp. For example:

        scp file.txt remote_username@10.10.0.2:/remote/directory/newfilename.txt

        kind regards, Lucas

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Next Post

Mapping Azure and Oracle Cloud Infrastructure core concepts - Part One

All major public clouds are organized in similar ways. However, terms used for certain similar constructs can be (quite) different, or the same terms are used for quite different constructs. This article attempts to outline some of the most relevant concepts for both Azure and Oracle Cloud Infrastructure and to […]
%d bloggers like this: