Professional Documents
Culture Documents
Google Cloud Cookbook Practical Solutions For Building and Deploying Cloud Services 1st Edition Rui Costa Drew Hodun
Google Cloud Cookbook Practical Solutions For Building and Deploying Cloud Services 1st Edition Rui Costa Drew Hodun
Google Cloud Cookbook Practical Solutions For Building and Deploying Cloud Services 1st Edition Rui Costa Drew Hodun
https://ebookmeta.com/product/google-cloud-cookbook-practical-
solutions-for-building-and-deploying-cloud-services-1st-edition-
rui-santos/
https://ebookmeta.com/product/programming-google-cloud-rui-costa/
https://ebookmeta.com/product/programming-google-cloud-rui-
costa-2/
https://ebookmeta.com/product/google-cloud-ai-services-quick-
start-guide-1st-edition-arvind-ravulavaru/
Building Serverless Applications with Google Cloud Run
A Real World Guide to Building Production Ready
Services 1st Edition Wietse Venema
https://ebookmeta.com/product/building-serverless-applications-
with-google-cloud-run-a-real-world-guide-to-building-production-
ready-services-1st-edition-wietse-venema/
https://ebookmeta.com/product/cloud-native-development-with-
google-cloud-daniel-vaughan/
https://ebookmeta.com/product/visualizing-google-
cloud-101-illustrated-references-for-cloud-engineers-and-
architects-1st-edition-priyanka-vergadia/
https://ebookmeta.com/product/cloud-native-devops-with-
kubernetes-building-deploying-and-scaling-modern-applications-in-
the-cloud-2nd-edition-justin-domingus-john-arundel/
https://ebookmeta.com/product/practical-spring-cloud-function-
developing-cloud-native-functions-for-multi-cloud-and-hybrid-
cloud-environments-1st-edition-banu-parasuraman/
Google Cloud Cookbook
Practical Solutions for Building and Deploying Cloud Services
Rui Costa
Before joining Google, I worked as a consultant where I helped
organizations adopt cloud services. As a consultant, I worked with
organizations to understand their business and technical
requirements. I helped them build architectures and deployment
strategies to migrate or build their applications successfully in the
cloud.
In my first three years at Google, I worked in a similar role, with a
strong emphasis on Google Cloud. About two years ago, I took a
new role at Google as a learning consultant. In my current role, I
build custom learning content for Google Cloud. Building new
learning programs requires me to stay updated as much as the
engineers who will be taking the course and using it to deploy their
applications on Google Cloud. For this, I always have to stay up-to-
date with the services Google Cloud provides.
When building these courses, I’m always referring to the Google
Cloud documentation website, collaborating with subject matter
experts, and learning from my students. This process takes time,
and I yearned for a book that I could reference for quick, repeatable
recipes. I decided to write this book as a reference for all to use and
gain quick access to recipes that you can use in your journey with
Google Cloud.
I also have a strong background in software engineering and tried to
apply this experience to the recipes in this book. You will find recipes
that are not just applicable to using Google Cloud services but also
to how to build your application with Google Cloud if it’s based on
Java, Go, Python, or Node.js. There is something for everyone.
Drew Hodun
Working for years as a customer-facing engineer at Google, I helped
customer after customer and engineer after engineer get started on
Google Cloud. I still love those aha moments I witness when an
engineer opens Cloud Shell in-browser for the first time or runs their
first BigQuery query that processes 100 billion regex expressions in
20 seconds. They are excited because they see the possibility to
build better, bigger, faster.
With this book, I hope to share many of the tips, tricks, and getting-
started knowledge that we’ve built up over the years onboarding
customers to Google Cloud and wish I’d known at the beginning of
my cloud journey. Although this book covers the products and
services of Google Cloud as well as some common architectural
patterns, it also contains slick shortcuts and advice throughout to
make you a more experienced Google Cloud engineer.
Constant width
Used for program listings, as well as within paragraphs to refer to
program elements such as variable or function names, databases,
data types, environment variables, statements, and keywords.
NOTE
This element signifies a general note.
Using Code Examples
Supplemental material (code examples, exercises, etc.) is available
for download at https://github.com/ruiscosta/oreilly-google-cloud-
cookbook.
If you have a technical question or a problem using the code
examples, please send email to bookquestions@oreilly.com.
This book is here to help you get your job done. In general, if
example code is offered with this book, you may use it in your
programs and documentation. You do not need to contact us for
permission unless you’re reproducing a significant portion of the
code. For example, writing a program that uses several chunks of
code from this book does not require permission. Selling or
distributing examples from O’Reilly books does require permission.
Answering a question by citing this book and quoting example code
does not require permission. Incorporating a significant amount of
example code from this book into your product’s documentation
does require permission.
We appreciate, but generally do not require, attribution. An
attribution usually includes the title, author, publisher, and ISBN. For
example: “Google Cloud Cookbook by Rui Santos Costa and Andrew
Hodun (O’Reilly). Copyright 2022 Drew Hodun and Rui Costa, 978-1-
492-09289-6.”
If you feel your use of code examples falls outside fair use or the
permission given above, feel free to contact us at
permissions@oreilly.com.
O’Reilly Online Learning
NOTE
For more than 40 years, O’Reilly Media has provided technology and business
training, knowledge, and insight to help companies succeed.
How to Contact Us
Please address comments and questions concerning this book to the
publisher:
O’Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the United States or Canada)
707-829-0515 (international or local)
707-829-0104 (fax)
We have a web page for this book, where we list errata, examples,
and any additional information. You can access this page at
https://oreil.ly/GCCookbook.
Email bookquestions@oreilly.com to comment or ask technical
questions about this book.
For news and information about our books and courses, visit
http://oreilly.com.
Find us on Facebook: http://facebook.com/oreilly
Follow us on Twitter: http://twitter.com/oreillymedia
Watch us on YouTube: http://youtube.com/oreillymedia
Acknowledgments
We would like to thank Hussein Sharif and James Duncan for
contributing several recipes to this book.
Thanks to Iain Foulds, Michael Hopkins and Aurélie Vache for their
insightful and thorough technical reviews.
And of course, many thanks to our team at O’Reilly—to Jennifer
Pollock for bringing us on board and proposing the book, to Jeff
Bleiel for accompanying us along the many months of writing, to
Caitlin Ghegan for the last mile burst of enthusiasm, and to Kerin
Forsyth for improving so greatly upon the content.
Rui Costa
With all my love, I want to thank my family for their support and for
always pushing me to grow: my wife Isabel, son Filipe, parents
Germano and Maria, sister Sonia, brother-in-law Michael, nephew
Thomas, father-in-law Joao, and mother-in-law Maria.
I also want to thank Anthony Okwechime, Lauren Kapnick, Russell
Goldenbroit, and Casey Palowitch for always being there for me and
believing in me.
Drew Hodun
A huge thanks to all who have helped me in my personal and
professional journey, who have taught me to learn and grow
joyously and to remember to be humble.
Thanks to Bob Scarborough, Italo Brito, and Lukman Ramsey for
believing in me and pushing me to the next level.
To Dad for his curiosity. To Mom for her wisdom. To Rose for her
spirit.
Chapter 1. Introduction
Overview
Like most cloud platforms, Google Cloud is a collection of physical
resources such as servers and storage as well as higher-level
services like BigQuery or AppEngine built on top of them, all running
in Google data centers. The platform is organized into zones,
regions, multiregions (continents), and then the entire globe.
Table 1-1 shows a rough mental model of what each of these
means.
3. Activate your free trial with the button in the upper right to
receive $300 in credits.
4. Add a credit card to get started, as shown in Figure 1-3. Don’t
worry; there is no autocharge or any extra charges after you go
through your $300, so long as you turn off VMs and delete your
data. It is generally hard to run up a huge bill, given your
default quota for resources.
Figure 1-3. Google Cloud credit card dialog box
You’ll notice a new project has been created for you, as in Figure 1-
4. You can decide to change the display name (but not the project
ID or project number), or you can create a new project with the
name you want.
Another random document with
no related content on Scribd:
"Oh, I don't know!" Some fresh thought seemed to come
up, and she shivered, though her cheeks were on fire. "I
don't know! Oh, I don't know."
Did she not know how much she cared for him?—Or
whether she loved him? Was that it? The poor little hands
tried to cover the burning face. "I don't know! I don't
know!" was all she seemed able to utter.
"To-morrow—then—"
"Oh—yes!"
Emmie fled; and Cyril stood alone, a consciousness already
creeping over him that he had run on faster than he had
intended. For some time past, he had seen this lying ahead,
not as a thing certain, but as a thing probable. Still, he had
not meant to bind himself so soon.
Overcome again!
Cyril fled from the house, as Emmie had fled from him. His
rapid escape can be told in no other words. He felt that he
could not breathe till he was outside in the street. Then,
dark and dull and wintry as it was, he started off at a
furious pace through Dutton, along the nearest country
road, and away to the marshlands, where as a boy he had
loved to wander with Jean.
For life!
Had he been mad? Was his seeming love for Emmie all a
delusion? It wavered, flickered, went out, this hour, in the
rush of his old passionate devotion to Jean. He felt that he
could live for Jean, could die for Jean, could wait any
number of years for Jean—if only he might hope to win her
in the end. But to be cut off from her utterly—! And by his
own action—!
If only he had not spoken that day! But then, would the
awakening love have come?
Miss Devereux was offended that her nephew had not come
home in time for dinner; and when he did appear, she
greeted him with reproaches. It was of no consequence, of
course—at least, of course she was of no consequence—but
she thought he might have the civility to tell her beforehand
when he meant to stay away—even though he was master
of the Brow, and poor she was nobody—still she did think
she had a right to be treated with at least a little proper
respect.
CHAPTER XII.
TAKING COUNSEL.
All the morning this went on, and much of the afternoon.
Emmie could be of little use. In his brighter moods, her
sunny sweetness was invaluable, but in his despair, he
needed a more practised hand.
Mrs. Lucas was not without help, however. The sad tale
reached Jem's ears by mid-day; and he came at once, to be
a tower of strength to the sorrowful wife, and to put fresh
courage into the heart of the broken-down man. He
promised to look in again next day; and he spoke kind
words to Emmie, who had wandered about the house,
wondering what she really felt, and whether such an
upheaval were actually to take place in her life, as would be
implied by her engagement to Sir Cyril Devereux.
"O mother!"
"Mother—"
"Yes. He—?"
"But—"
"But what?"
Emmie sighed.
"He is so nice," she said, "so very very nice and pleasant.
And I do look up to him really, because he is so clever. I like
him—oh, ever so much. It's almost a little like loving. Not
like the sort of love I have for you, of course; because I
don't think anything ever could be the same as that—but
still—I do like to see him come in, and it would be very dull
if he never came. Don't you think it would?"
"If you were Sir Cyril's wife, your duty would be to him, not
to us. He is a man of leisure, and his wife will have her time
well filled. Dear Emmie, you must put the thought of us
quite aside, and think only of yourself and him. Only you
and him! Could you promise to love him all your life—first
and best? To love him?"
"Not so much as I love you, of course, mother! How could I
possibly?"—with a look of infantine sweetness. "And I
should be miserable if I couldn't see you every day, and tell
you every single thing as I do now. But I don't like to make
him unhappy."
"Yes: I see! And you think I had better say 'No' at once?"
"I think you must decide for yourself; but I am very much
afraid of a hasty 'Yes,'—for your sake, and for his. I am
afraid you might both regret it."
"Yes; I understand. O no; it wouldn't do! Mother, I really am
glad. Perhaps I'm a little sorry too, because the Brow and
everything would be so nice—except Miss Devereux and
Lady Lucas! I should like it so much for you and my father .
. . But, of course, that isn't enough. I mean it wouldn't be
right to marry him for the sake of anybody else! . . . And
somehow, I can't think of Sir Cyril as—as—a husband!"—
blushing furiously. "I like him very much indeed, just
coming in and out. But I almost think—I'm afraid I should
get just a little tired of him, if it were always and always
going on."
"Really, Cyril—"
When dessert was on the table, and the man had vanished,
she began anew—
"The main fact is true. Lady Lucas has only improved upon
it a little—not more than one might reasonably expect! He
was not 'dead drunk,' and he did not require to be carried, I
believe—but unhappily, he did take too much."
"Is anything the matter? Are you ill?" startled by his look. "I
will send for Dr. Ingram."
The tension had become too great, and the whole room
went round dizzily. He could not have stood alone, or
walked slowly, but he was able to dash across the hall and
into the study, where he flung himself on the sofa, in an
overpowering whirl of brain and mind, physical giddiness
predominating for the moment over all else.