在 Application Design Center 中設定 Cloud Storage

Cloud Storage 可讓您隨時在世界各地儲存及擷取任意資料量的資料。Cloud Storage 適用於多種情況,包括為網站提供內容、儲存資料以供封存和災難復原之用,或是透過直接下載的方式將大量資料物件發布給眾多使用者。詳情請參閱 Cloud Storage 產品總覽

本文說明使用 App Design Center 建立 Cloud Storage bucket 時,可設定的連線和參數。設定參數是以 terraform-google-cloud-storage Terraform 模組為依據。

元件連線

下表列出可連結至 Cloud Storage 值區的元件,以及應用程式和產生的 Terraform 程式碼的後續更新。

已連結的元件

應用程式更新

背景資訊

Compute Engine 執行個體範本

  • Compute Engine 執行個體可以控制 bucket 物件,包括列出、建立、檢視及刪除物件。
  • roles/storage.objectAdmin 角色會指派給 Compute Engine 執行個體範本服務帳戶。
設定及管理 bucket 的 IAM 政策

服務帳戶

  • 服務帳戶可以管理 Cloud Storage bucket 中的物件。
  • 服務帳戶 IAM 資訊會新增至 Cloud Storage bucket。
  • roles/storage.objectAdmin 角色指派給服務帳戶。
設定及管理 bucket 的 IAM 政策

Cloud Run

  • Cloud Run 服務可以管理 Cloud Storage bucket 中的物件。
  • Cloud Run 服務帳戶 IAM 資訊會新增至 Cloud Storage bucket。
  • roles/storage.objectAdmin 角色會指派給 Cloud Run 服務帳戶。
連結 Google Cloud 服務

Pub/Sub

  • Pub/Sub 訂閱項目可將訊息寫入 Cloud Storage 值區。
  • Cloud Storage 值區資訊會新增至 Pub/Sub 訂閱欄位。
Cloud Storage 訂閱方案

必要設定參數

如果範本包含 Cloud Storage 元件,您必須先設定下列參數,才能部署範本。

參數名稱

說明和限制

背景資訊

專案 ID

要部署 Cloud Storage 資源的專案。

設定元件

區域

location 值區位置

名稱

name Bucket 名稱

選用設定參數

以下是視需要選用的參數。如要顯示進階參數,請在「設定」區域選取「顯示進階欄位」

功能

參數名稱

說明和限制資訊

背景資訊

儲存空間類別

storageClass 儲存空間類別

僅值區政策

iamConfiguration.uniformBucketLevelAccess 統一值區層級存取權

版本管理

versioning.enabled 物件版本管理

Autoclass

autoclass.enabled Autoclass
資料保留政策

已鎖定

retentionPolicy.isLocked 值區鎖定

保留期限

retentionPolicy.retentionPeriod 保留政策

加密

預設 KMS 金鑰名稱

encryption.defaultKmsKeyName 使用客戶自行管理的加密金鑰

生命週期規則

類型

lifecycle.rule[].action.type 物件生命週期管理

儲存空間類別

lifecycle.rule[].action.storageClass setStorageClass

年齡

lifecycle.rule[].condition.age 年齡

Send Age If Zero

send_age_if_zero lifecycle_rules

建立時間早於

lifecycle.rule[].condition.createdBefore createdBefore

含州別

with_state lifecycle_rules

符合儲存空間類別

lifecycle.rule[].condition.matchesStorageClass[] matchesStorageClass

相符前置字串

lifecycle.rule[].condition.matchesPrefix[] matchesPrefix 和 matchesSuffix

相符後稱謂

lifecycle.rule[].condition.matchesSuffix[] matchesPrefix 和 matchesSuffix

Num Newer Versions

lifecycle.rule[].condition.numNewerVersions numNewerVersions

自訂時間早於

lifecycle.rule[].condition.customTimeBefore customTimeBefore

自訂時間迄今的天數

lifecycle.rule[].condition.daysSinceCustomTime daysSinceCustomTime

變更為非現行版本後至今的天數

lifecycle.rule[].condition.daysSinceNoncurrentTime daysSinceNoncurrentTime

非現行時間早於

lifecycle.rule[].condition.noncurrentTimeBefore noncurrentTimeBefore

內部加密設定

建立加密金鑰

如要建立 Cloud Key Management Service 金鑰環和金鑰,請選取核取方塊。 客戶自行管理的加密金鑰

防止毀損

如要防止 Cloud KMS 金鑰遭到刪除,請勾選核取方塊。 金鑰版本和鎖定的物件

Key Destroy Scheduled Duration

destroyScheduledDuration 金鑰版本和鎖定的物件

金鑰輪替週期

rotationPeriod 金鑰輪替

強制刪除

如要在刪除 bucket 時一併刪除當中包含的所有物件,請勾選核取方塊。

force_destroy

IAM 成員

角色

您要授予的權限集合。

設定及管理 bucket 的 IAM 政策

成員

獲授角色的主體。

設定及管理 bucket 的 IAM 政策

標籤

金鑰

labels 標記和標籤

labels 標記和標籤

自訂刊登位置設定

資料位置

customPlacementConfig.dataLocations[] 雙區域

CORS

來源

cors[].origin[] 跨源資源共享 (CORS)

方法

cors[].method[] CORS 的運作方式

回應標頭

cors[].responseHeader[] CORS 設定的元件

Max Age Seconds

cors[].maxAgeSeconds[] CORS 設定的元件

記錄值區

logging.logBucket 使用記錄檔和儲存空間記錄檔

記錄物件前置字串

logging.logObjectPrefix 使用記錄檔和儲存空間記錄檔

網站

主頁面尾碼

website.mainPageSuffix 建議:指派專用頁面

找不到頁面

website.notFoundPage 建議:指派專用頁面

禁止公開存取

iamConfiguration.publicAccessPrevention 禁止公開存取

虛刪除政策

保留時間長度 (秒)

softDeletePolicy.retentionDurationSeconds 虛刪除