Using Google Cloud Console on your iphone
Making the most of your iphone to use GCP products, services and resources
I wanted to explore capabilities of the google cloud console app available on the app store for iphone. And, in particular to determine whether it is possible to complete an entire qwiklab using only my phone. In this post I test it out...I will explore the instructions for the qwiklab: Cloud IAM: Qwik Start
wget --output-document sample.txt https://gofile.io/d/sChbNs
Note: most of the resources needed to build simple tasks are available, some are not.
As of 6 August 2020 kubernetes engine is added to the navigation menu. I have found that while some features are unavailable, those tasks can still be carried out using the shell.
Here is a link to the download and description page to for the google cloud console app: https://apps.apple.com/la/app/google-cloud-console/id1005120814
PREREQUISITES
Download and install the Google Cloud Console app on the App Store (117MB)
1. Sign in
I used the lab credentials provided by qwiklabs to log in to the console. I have two separate lab credentials and will show you how you can log in with both and switch between accounts.
On the left navigation menu, click Sign in and enter your login details.
Your screen should look like this. Click on 'switch accounts'
or click on the menu again and click on 'Add another account'
Login with you other credentials.
You will be presented with the same welcome message you normally see on your web browser, accept the terms.
To use the app features you have to ensure that your account is always linked to a project.
Click on the menu and click on Current project and select and existing project or a project ID provided to you by qwiklabs.
As you can see there are two student usernames that have access to the same project. This is the project needed for the lab. Select the project.
2. Testing Cloud IAM features
On the web app the left navigation menu has a service called Cloud IAM but on the app you need to use Permissions on the menu at the bottom of your screen.
If you do not have a project selected you might get an error message. Click on the top of your screen and select a project.
If I am signed into two accounts I should be able to see all the user roles assigned to them.
To add a role, click on the + icon in the corner of the screen.
You should see this:
To add a role, enter a username, and select the role you want to assign to this user.
The app only allows a user to view a bucket if one is already assigned to a project.
In order to create a bucket we need to use the shell.
Click on the left menu and select Cloud Shell
The shell takes about 3 minutes to start.
The shell is not configured to a project. To use the shell you need t configure your project ID.
Run the following command and replace [PROJECT ID] with your assigned/ existing project ID:
gcloud config set project [PROJECT ID]
Now create a bucket using the mb (make bucket) command with multi-regional storage class and give it a unique name:
gsutil mb -c multi-regional gs://[BUCKET-NAME]
Now if you return to the menu at the bottom, select Resources and click on Cloud Storage you should be able to see the bucket you just created.
If you switch users, the second user should be able to see the bucket as well.
3. Copying content to a bucket from your phone (or cheat the lab)
The downside of an iphone is that it uses a graphical file management system.
The google console app does not have any upload feature. And it is not possible to see the file structure of an image without tethering your iphone to a computer.
There may seem like no way to upload a file besides using your browser to login and upload a file from the full feature web app...
But this experiment assumes you have no access to a computer.
So download a file directly to the shell you are working on.
Goto the following address, and grab the link to this random file by running this command:
Next, use the following command to upload an image to your created bucket:
gsutil cp sample.txt gs://[BUCKET NAME]
This will upload the file from the link to the bucket.
or
Run this command and replace [BUCKET NAME] with your bucket name:
touch sample.txt gs://[BUCKET NAME]
This will create an empty file in the bucket and assign it the name sample.txt
4. Changing Permissions
I can return to left menu to switch accounts again.
Click on the second username and select the option with the pencil that says Change role
Type or copy and paste the username from the menu into the field provided
Select the role to change. Change the option from Editor to Viewer
5. View Permissions
Open the shell again.
Run the following command to test if the second user has access to the file in the bucket:
gsutil ls gs://[BUCKET NAME]
If you removed the user, or changed the user's role then you will no longer have have access to the project and get an error in the shell.
You might still see the file on the console but this is because the console app fails to refresh automatically.
Therefore, each time you make a change, go to the menu and select the project ID again to refresh, or
Switch accounts, then switch back to the account you want to make changes. Then make sure you tap on the project ID again.
Review for lab Cloud IAM: By following the lab and using standard google cloud console app features you will be able to obtain score 100% for this lab, completed 100% on your phone!















Comments