Building Google Cloud Platform Solutions
上QQ阅读APP看书,第一时间看更新

Launching the Cloud Shell

The Cloud Shell can be launched from the Cloud Console via the Activate Google Cloud Shell button on the top right of the Cloud Console UI. Your first time launching the Cloud Shell will take a few moments while a Compute Engine VM and persistent disk are provisioned for you. This time will decrease in subsequent sessions, as shown in the following screenshot:

The Google Cloud Shell

The Google Cloud Shell shown in the preceding screenshot is an interactive shell that offers a full Terminal experience in the browser. Various tools and actions are available along the top of the Cloud Shell window.

After establishing a session, you'll notice that your prompt includes the project ID for the project that you are currently viewing in the Cloud Console. This is because the Cloud Shell is contextually aware of the environment in which you are operating. Your session is also authenticated on login, meaning you can instantly access any resources for which you are authorized. One thing to note about this context awareness is that your shell is tied to your account rather than a specific project. This means that changes made to the underlying VM while in one project will be present when using the shell within the context of another project. This is true whether or not changes are made within the $HOME directory.

Because the Cloud Shell VM is designed specifically for interactive activities only, it is an ill-suited platform for doing many standard operational tasks. For example, tasks scheduled via cron will stop executing shortly after the user session is terminated. Likewise, long-running tasks will be halted mid-operation once the session becomes inactive. This time window usually lasts about an hour.