次の表に、gcloud storage コマンドの実行に必要な Identity and Access Management(IAM)権限を示します。複数の IAM 権限がバンドルされ、ロールが作成されます。プリンシパルにロールを付与します。
ワイルドカード、--recursive フラグ、--billing-project フラグを使用する際の注意事項については、表の下のセクションをご覧ください。
| コマンド | フラグ | 必要な IAM 権限 |
|---|---|---|
batch-operations jobs create |
storagebatchoperations.jobs.create |
|
batch-operations jobs cancel |
storagebatchoperations.jobs.cancel |
|
batch-operations jobs delete |
storagebatchoperations.jobs.delete |
|
batch-operations jobs get |
storagebatchoperations.jobs.get |
|
batch-operations jobs list |
storagebatchoperations.jobs.list |
|
buckets add-iam-policy-binding |
storage.buckets.getstorage.buckets.getIamPolicystorage.buckets.setIamPolicystorage.buckets.update |
|
buckets anywhere-caches create |
storage.anywhereCaches.create |
|
buckets anywhere-caches describe |
storage.anywhereCaches.get |
|
buckets anywhere-caches list |
storage.anywhereCaches.list |
|
buckets anywhere-caches update |
storage.anywhereCaches.update |
|
buckets anywhere-caches pause |
storage.anywhereCaches.pause |
|
buckets anywhere-caches resume |
storage.anywhereCaches.resume |
|
buckets anywhere-caches disable |
storage.anywhereCaches.disable |
|
buckets create |
storage.buckets.create
storage.buckets.setIpFilter15 |
|
buckets delete |
storage.buckets.delete |
|
buckets describe |
storage.buckets.getstorage.buckets.getIamPolicy1storage.buckets.getIpFilter16 |
|
buckets get-iam-policy |
storage.buckets.getstorage.buckets.getIamPolicy |
|
buckets list |
storage.buckets.liststorage.buckets.getIamPolicy1 |
|
buckets notifications create |
storage.buckets.getstorage.buckets.updatepubsub.topics.get(Pub/Sub トピックを含むプロジェクト)pubsub.topics.create3(Pub/Sub トピックを含むプロジェクト)pubsub.topics.getIamPolicy(通知を受信する Pub/Sub トピック)pubsub.topics.setIamPolicy3(通知を受信する Pub/Sub トピック) |
|
buckets notifications create |
--skip-topic-setup |
storage.buckets.getstorage.buckets.update |
buckets notifications delete |
storage.buckets.getstorage.buckets.update |
|
buckets notifications describe |
storage.buckets.get |
|
buckets notifications list |
storage.buckets.get |
|
buckets relocate |
storage.buckets.relocate |
|
buckets remove-iam-policy-binding |
storage.buckets.getstorage.buckets.getIamPolicystorage.buckets.setIamPolicystorage.buckets.update |
|
buckets set-iam-policy |
storage.buckets.setIamPolicystorage.buckets.update |
|
buckets update |
storage.buckets.updatestorage.buckets.setIpFilter15 |
|
buckets update |
--no-requester-pays |
storage.buckets.updateresourcemanager.projects.createBillingAssignment2 |
buckets update |
--recovery-point-objective--rpo--[no-]uniform-bucket-level-access |
storage.buckets.getstorage.buckets.update |
buckets update |
--clear-pap--clear-public-access-prevention--[no-]pap--[no-]public-access-prevention |
storage.buckets.getstorage.buckets.updatestorage.buckets.setIamPolicy |
cat |
storage.objects.getstorage.objects.list13 |
|
cp |
storage.objects.getstorage.objects.createstorage.objects.list4(宛先バケット)
storage.objects.delete5storage.buckets.get12 |
|
du |
storage.objects.list |
|
folders create |
storage.folders.create |
|
folders delete |
storage.folders.delete |
|
folders describe |
storage.folders.get |
|
folders list |
storage.folders.list |
|
folders rename |
storage.folders.renamestorage.folders.create |
|
hash |
storage.objects.get |
|
hmac create |
storage.hmacKeys.create |
|
hmac delete |
storage.hmacKeys.delete |
|
hmac describe |
storage.hmacKeys.get |
|
hmac list |
storage.hmacKeys.list |
|
hmac update |
storage.hmacKeys.update |
|
insights dataset-configs create |
storageinsights.datasetConfigs.create |
|
insights dataset-configs create-link |
storageinsights.datasetConfigs.linkDataset |
|
insights dataset-configs delete |
storageinsights.datasetConfigs.delete |
|
insights dataset-configs delete-link |
storageinsights.datasetConfigs.unlinkDataset |
|
insights dataset-configs describe |
storageinsights.datasetConfigs.get |
|
insights dataset-configs list |
storageinsights.datasetConfigs.list |
|
insights dataset-configs update |
storageinsights.datasetConfigs.update |
|
insights inventory-reports create |
storageinsights.reportConfigs.create |
|
insights inventory-reports delete |
storageinsights.reportConfigs.delete |
|
insights inventory-reports details list |
storageinsights.reportDetails.list |
|
insights inventory-reports details describe |
storageinsights.reportDetails.get |
|
insights inventory-reports list |
storageinsights.reportConfigs.list |
|
insights inventory-reports update |
storageinsights.reportConfigs.getstorageinsights.reportConfigs.update |
|
ls(バケットの一覧表示) |
storage.buckets.liststorage.buckets.getIamPolicy6 |
|
ls(オブジェクトを一覧表示する場合) |
storage.objects.get7storage.objects.liststorage.objects.getIamPolicy8 |
|
ls |
--buckets |
storage.buckets.getstorage.buckets.getIamPolicy6 |
storage intelligence-config enable |
storage.intelligenceConfigs.update |
|
storage-intelligence disable |
storage.intelligenceConfigs.update |
|
storage-intelligence describe |
storage.intelligenceConfigs.get |
|
storage-intelligence update |
storage.intelligenceConfigs.update |
|
mv |
storage.objects.getstorage.objects.deletestorage.objects.createstorage.objects.list4storage.objects.delete5storage.buckets.get12 |
|
objects compose |
storage.objects.getstorage.objects.createstorage.objects.delete9 |
|
objects describe |
storage.objects.getstorage.objects.getIamPolicy8 |
|
objects list |
storage.objects.liststorage.objects.getIamPolicy8 |
|
objects update |
storage.objects.getstorage.objects.liststorage.objects.update |
|
objects update |
--storage-class--encryption-key--clear-encryption-key |
storage.objects.getstorage.objects.liststorage.objects.createstorage.objects.delete |
objects update |
--retention-mode--retain-until--clear-retention |
storage.objects.getstorage.objects.liststorage.objects.updatestorage.objects.setRetentionstorage.objects.overrideUnlockedRetention11 |
operations cancel |
storage.bucketOperations.cancel |
|
operations describe |
storage.bucketOperations.get |
|
operations list |
storage.bucketOperations.list |
|
restore |
storage.objects.createstorage.objects.delete9storage.objects.restore |
|
restore |
--async |
storage.objects.createstorage.objects.delete14storage.objects.restorestorage.buckets.restore |
rm |
storage.buckets.deletestorage.objects.deletestorage.objects.list |
|
rsync |
storage.objects.liststorage.objects.getstorage.objects.liststorage.objects.getstorage.objects.createstorage.objects.delete10storage.buckets.get12 |
|
rsync |
--dry-run |
storage.objects.list(ソースバケットと宛先バケット) |
service-agent |
resourceManager.projects.get |
|
sign-url |
なし。ただし、このコマンドの一部として鍵が使用されているサービス アカウントには、署名付き URL にエンコードされたリクエストを実行する権限が必要です。 |
1 この権限は、詳細の中に IAM ポリシーを含める場合にのみ必要です。
2 この権限は、リクエストに請求先プロジェクトを含めない場合にのみ必要です。詳細については、リクエスト元による支払いの使用条件とアクセス要件をご覧ください。
3 この権限は、トピックがすでに存在し、当該サービス アカウントにそのトピックへのアクセス権がある場合は必要ありません。
4 この権限は、コマンドの宛先にオブジェクトのパスが含まれている場合にのみ必要です。
5 この権限は、並列複合アップロードを使用する場合や、--no-clobber フラグを使用せずにバケット内にすでに存在しているオブジェクトと同じ名前のオブジェクトを挿入する場合にのみ必要です。
6 この権限は、詳細の中に IAM ポリシーを含める場合にのみ必要です。
7 この権限は、--fetch-encrypted-object-hashes フラグを使用する場合にのみ必要です。
8 この権限は、詳細の中に IAM ポリシーを含める場合にのみ必要です。この権限は、均一なバケットレベルのアクセスが有効になっているバケットには適用されません。
9 この権限は、バケット内にすでに存在するオブジェクトと同じ名前でオブジェクトを作成する場合にのみ必要です。
10 この権限は、--delete-unmatched-destination-objects フラグを使用する場合や、バケット内にすでに存在しているオブジェクトと同じ名前のオブジェクトと同じ名前で、別のデータを持つオブジェクトを挿入する場合にのみ必要です。
11 この権限は、リクエストで --override-unlocked-retention フラグを使用する必要がある場合にのみ必要です。
12 この権限は、gcloud CLI プロパティ storage/parallel_composite_upload_compatibility_check が True に設定されている場合に、並列複合アップロードを実行するために必要です。
13 この権限は、正規表現を使用してオブジェクトを取得する場合にのみ必要です。
14 この権限は、リクエストに --allow-overwrite フラグが含まれており、バケット内にすでに存在するオブジェクトと同じ名前でオブジェクトを作成する場合にのみ必要です。
15 この権限は、バケットの IP フィルタリング ルールを作成、更新、削除するフラグ --ip-filter-file がリクエストに含まれている場合にのみ必要です。
16 この権限は、レスポンスの一部としてバケットの IP フィルタ構成を取得する場合にのみ必要です。
--billing-project トップレベル フラグ
--billing-project グローバル フラグを使用して、リクエストの料金の請求先プロジェクトを指定する場合は、指定するプロジェクトに対する serviceusage.services.use 権限が必要です。たとえば、リクエスト元による支払いが有効にされているバケットにアクセスするには、--billing-project フラグが必要です。
ワイルドカードと再帰フラグ
1 つのコマンドの中で URI ワイルドカードを使用して複数のオブジェクトを選択する場合は、それらのオブジェクトを含むバケットに対する storage.objects.list 権限が必要です。同じように、1 つのコマンドの中で URI ワイルドカードを使用して複数のバケットを選択する場合は、それらのバケットが含まれるプロジェクトに対する storage.buckets.list 権限が必要です。
--recursive フラグを使用する場合は、使用している特定のコマンドに必要な権限に加えて、関連するバケットに対する storage.objects.list 権限が必要です。
次のステップ
- プロジェクト レベルとバケットレベルで IAM ロールを割り当てる。
- Cloud Storage の権限を含む IAM ロールを確認する。