Menemukan penyimpanan objek dengan konsol Google Cloud

Pelajari cara mulai menggunakan Cloud Storage menggunakan konsol Google Cloud .

Biaya yang dikenakan di Cloud Storage didasarkan pada resource yang Anda gunakan. Panduan memulai ini biasanya menggunakan resource Cloud Storage senilai kurang dari $0,01 USD.


Untuk mengikuti panduan langkah demi langkah untuk tugas ini langsung di Google Cloud konsol, klik Pandu saya:

Pandu saya


Sebelum memulai

  1. Login ke akun Google Cloud Anda. Jika Anda baru menggunakan Google Cloud, buat akun untuk mengevaluasi performa produk kami dalam skenario dunia nyata. Pelanggan baru juga mendapatkan kredit gratis senilai $300 untuk menjalankan, menguji, dan men-deploy workload.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Make sure that you have the following role or roles on the project: Storage Admin

    Check for the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.

    4. For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.

    Grant the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. Click Grant access.
    4. In the New principals field, enter your user identifier. This is typically the email address for a Google Account.

    5. Click Select a role, then search for the role.
    6. To grant additional roles, click Add another role and add each additional role.
    7. Click Save.
  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  6. Verify that billing is enabled for your Google Cloud project.

  7. Make sure that you have the following role or roles on the project: Storage Admin

    Check for the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.

    4. For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.

    Grant the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. Click Grant access.
    4. In the New principals field, enter your user identifier. This is typically the email address for a Google Account.

    5. Click Select a role, then search for the role.
    6. To grant additional roles, click Add another role and add each additional role.
    7. Click Save.

Membuat bucket

Bucket adalah container dasar yang menyimpan data Anda di Cloud Storage.

Untuk membuat bucket:

  1. Di konsol Google Cloud , buka halaman Buckets Cloud Storage.

    Buka Buckets

  2. Klik Create.

  3. Di bagian Mulai, masukkan nama yang unik secara global untuk bucket Anda.

  4. Di bagian Pilih tempat untuk menyimpan data Anda, untuk Jenis lokasi, pilih Region. Gunakan nilai default di kolom ini.

  5. Di bagian Choose how to store your data, gunakan nilai default.

  6. Di bagian Choose how to control access to objects, hapus centang pada kotak Enforce public access prevention on this bucket. Tindakan ini memungkinkan Anda membagikan objek tersebut nanti.

  7. Di bagian Pilih cara melindungi data objek, gunakan nilai default.

  8. Klik Create.

Selesai — Anda baru saja berhasil membuat bucket Cloud Storage!

Mengupload objek ke dalam bucket

  1. Simpan gambar berikut ke perangkat Anda.

    Anak kucing dengan cakarnya terulur.

  2. Di halaman Bucket details, di tab Objects, klik Upload. Kemudian, pilih Upload file.

  3. Di perangkat Anda, temukan dan pilih gambar yang sebelumnya Anda simpan.

Setelah upload selesai, Anda akan melihat nama file dan informasi tentang file tersebut, misalnya ukuran dan jenisnya.

Mendownload objek

Untuk mendownload gambar dari bucket, klik Download.

Berbagi objek

Untuk mengizinkan publik mengakses bucket dan membuat URL yang dapat diakses oleh publik untuk image:

  1. Klik tab Permissions.

  2. Klik Grant Access.

  3. Di kolom New principals, masukkan allUsers.

  4. Di daftar Select a role, pilih Cloud Storage. Kemudian, pilih Storage Object Viewer.

  5. Klik Simpan.

  6. Di dialog Are you sure you want to make this resource public?, klik Allow public access.

    Untuk memverifikasi, klik tab Objects untuk kembali ke daftar objek. Kolom Public access objek harus menampilkan Public to internet. Tombol Copy URL menyediakan URL yang dapat dibagikan yang serupa dengan URL berikut:https://storage.googleapis.com/YOUR_BUCKET_NAME/kitten.png

Untuk menghapus akses publik dari bucket dan berhenti membagikan image secara publik:

  1. Klik tab Permissions.

  2. Di kolom Principal, temukan akun utama allUsers, lalu centang kotak yang terkait dengannya.

  3. Klik tombol Hapus Akses, lalu konfirmasi saat diminta.

    Di tab Objects, Anda akan melihat bahwa gambar tidak lagi memiliki tombol Copy URL.

Membuat folder simulasi

  1. Di tab Objects, klik Create folder.

  2. Di kolom Name, masukkan quickstart-folder.

  3. Klik Create.

    Folder simulasi akan muncul di bucket, dengan ikon folder yang membedakannya dari objek.

  4. Untuk mengupload file ke folder simulasi, lakukan hal berikut:

    1. Klik quickstart-folder.

    2. Klik Upload, lalu pilih Upload file.

    3. Di perangkat Anda, temukan dan pilih gambar yang sebelumnya Anda simpan.

      Setelah upload selesai, Anda akan melihat nama file dan informasi tentang file tersebut, misalnya ukuran dan jenisnya.

Menghapus objek

  1. Di panel Folder browser, klik nama bucket Anda.

  2. Centang kotak di samping quickstart-folder.

  3. Klik Hapus, lalu konfirmasi saat diminta.

    Folder simulasi dan semua objek di dalamnya akan dihapus.

Pembersihan

Agar akun Google Cloud Anda tidak dikenai biaya untuk resource yang digunakan pada halaman ini, ikuti langkah-langkah berikut.

  1. Di konsol Google Cloud , buka halaman Buckets Cloud Storage.

    Buka Buckets

  2. Pilih kotak centang di samping bucket yang Anda buat.

  3. Klik Hapus, lalu konfirmasi saat diminta.

Langkah berikutnya