Using Spanner in a virtual machine instance  |  Google Cloud (2024)

Stay organized with collections Save and categorize content based on your preferences.

This page describes how to grant your Compute Enginevirtual machine instance permission to access aSpanner database.

Your instance can access the Cloud Spanner API from Compute Engine byusing a service account to act on your behalf. The service account providesapplication default credentialsfor your applications so that you don't need to configure eachCompute Engine instance to use your personal user credentials.

Configure the service account on your instance with one of the followingoptions:

  • For easy development and testing, configure your instance touse the default service account with full access to all Cloud APIs.
  • For production environments,create a service account with read and write access to your Spanner databasesand apply it to your instance.

Configure an instance with access to all Cloud APIs

To quickly allow your instance to access the Cloud Spanner API, create a new instanceto use the default service account and a scope with full access to all CloudAPIs.

  1. Go to the Compute Engine VM instances page.

    Go to the VM instances page

  2. Select your project and click Continue.

  3. Click Create Instance to start creating a new instance.

  4. In the Identity and API access section, click Allow full access to all Cloud APIs.

  5. Configure other instance settings as needed, then click Create.

Now that the service account on your Compute Engine instance has accessto the Cloud Spanner API, use a client library to readand write data in your Spanner database. The instance uses thecredentials from the default service account to authenticate with theCloud Spanner API.

Configure an instance with a service account

To restrict instance access to specific APIs and roles, create a serviceaccount with permission only to access your Spannerdatabases. Then, apply the service account to your instance.

  1. Select a service account that will act on your behalf to accessSpanner. Use one of the following options:

  2. Grant a role to the service accountso that it has the necessary permissions to access Spanner. For alist of roles that apply to Spanner, seeAccess Control for Spanner.

  3. Go to the Compute Engine VM instances page.

    Go to the VM instances page

  4. Select your project and click Continue.

  5. Click Create Instance to start creating a new instance.

  6. In the Identity and API access section, select the service accountfrom the list under Service account.

  7. Configure other instance settings as needed, then click Create.

Now that the service account on your Compute Engine instance has accessto the Cloud Spanner API, use a client library to readand write data in your Spanner database. The instance uses theservice account credentials to authenticate with the Cloud Spanner API.

What's next

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-09-10 UTC.

Using Spanner in a virtual machine instance  |  Google Cloud (2024)
Top Articles
About
9 common problems our interior designers solve
Bleak Faith: Forsaken – im Test (PS5)
Enrique Espinosa Melendez Obituary
Garrison Blacksmith Bench
Angela Babicz Leak
Grange Display Calculator
Fnv Turbo
Call of Duty: NEXT Event Intel, How to Watch, and Tune In Rewards
Devourer Of Gods Resprite
Jet Ski Rental Conneaut Lake Pa
What is a basic financial statement?
Craigslist Pets Longview Tx
Cooking Fever Wiki
What Time Chase Close Saturday
24 Hour Walmart Detroit Mi
Best Suv In 2010
N2O4 Lewis Structure & Characteristics (13 Complete Facts)
Paychex Pricing And Fees (2024 Guide)
Adam4Adam Discount Codes
G Switch Unblocked Tyrone
Ukc Message Board
Td Small Business Banking Login
Lista trofeów | Jedi Upadły Zakon / Fallen Order - Star Wars Jedi Fallen Order - poradnik do gry | GRYOnline.pl
Kirksey's Mortuary - Birmingham - Alabama - Funeral Homes | Tribute Archive
Empire Visionworks The Crossings Clifton Park Photos
Sherburne Refuge Bulldogs
15 Primewire Alternatives for Viewing Free Streams (2024)
Foodsmart Jonesboro Ar Weekly Ad
Wrights Camper & Auto Sales Llc
Jazz Total Detox Reviews 2022
Scat Ladyboy
Swgoh Boba Fett Counter
Clearvue Eye Care Nyc
Eaccess Kankakee
Teenbeautyfitness
Quality Tire Denver City Texas
Kaiju Paradise Crafting Recipes
Iban's staff
Movies123.Pick
R Nba Fantasy
Tgirls Philly
Tableaux, mobilier et objets d'art
Pathfinder Wrath Of The Righteous Tiefling Traitor
Displacer Cub – 5th Edition SRD
The Largest Banks - ​​How to Transfer Money With Only Card Number and CVV (2024)
Sams Gas Price San Angelo
1Tamilmv.kids
Vcuapi
One Facing Life Maybe Crossword
Latest Posts
Article information

Author: Velia Krajcik

Last Updated:

Views: 6171

Rating: 4.3 / 5 (74 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Velia Krajcik

Birthday: 1996-07-27

Address: 520 Balistreri Mount, South Armand, OR 60528

Phone: +466880739437

Job: Future Retail Associate

Hobby: Polo, Scouting, Worldbuilding, Cosplaying, Photography, Rowing, Nordic skating

Introduction: My name is Velia Krajcik, I am a handsome, clean, lucky, gleaming, magnificent, proud, glorious person who loves writing and wants to share my knowledge and understanding with you.