jpskill.com
💼 ビジネス コミュニティ

gcp-cloud-storage

Google Cloud Storageを使い、データの保管場所であるバケットを作成・設定したり、ファイルをアップロードして整理したり、一時的に安全なアクセスを許可するURLを発行したり、コストを抑えるためのルールを設定したり、アクセス制限を管理したりするSkill。

📜 元の英語説明(参考)

Manage Google Cloud Storage for scalable object storage. Create and configure buckets, upload and organize objects, generate signed URLs for secure temporary access, set lifecycle rules for cost optimization, and configure access control.

🇯🇵 日本人クリエイター向け解説

一言でいうと

Google Cloud Storageを使い、データの保管場所であるバケットを作成・設定したり、ファイルをアップロードして整理したり、一時的に安全なアクセスを許可するURLを発行したり、コストを抑えるためのルールを設定したり、アクセス制限を管理したりするSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o gcp-cloud-storage.zip https://jpskill.com/download/14930.zip && unzip -o gcp-cloud-storage.zip && rm gcp-cloud-storage.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/14930.zip -OutFile "$d\gcp-cloud-storage.zip"; Expand-Archive "$d\gcp-cloud-storage.zip" -DestinationPath $d -Force; ri "$d\gcp-cloud-storage.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して gcp-cloud-storage.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → gcp-cloud-storage フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

GCP Cloud Storage

Google Cloud Storage は、グローバルなエッジキャッシュを備えた統合オブジェクトストレージサービスです。コスト最適化のために複数のストレージクラス(Standard、Nearline、Coldline、Archive)を提供し、強力な整合性とすべての GCP サービスとの統合を実現します。

コアコンセプト

  • Bucket — グローバルに一意なコンテナで、プロジェクトとロケーションにスコープされます
  • Object — メタデータを持つファイルで、バケット内の名前(パス)で識別されます
  • Storage Class — Standard、Nearline (30日)、Coldline (90日)、Archive (365日)
  • Signed URL — 認証情報なしで認証されたアクセスを行うための時間制限付き URL
  • Lifecycle Rule — 経過時間、クラス、または条件に基づいた自動アクション
  • IAM / ACL — バケットおよびオブジェクトレベルでのアクセス制御

バケット操作

# ロケーションとデフォルトのストレージクラスを指定してバケットを作成
gcloud storage buckets create gs://my-app-assets-prod \
  --location=us-central1 \
  --default-storage-class=STANDARD \
  --uniform-bucket-level-access
# バケットをリスト表示
gcloud storage ls
# バケットをパブリック読み取りに設定(静的ホスティング用)
gcloud storage buckets add-iam-policy-binding gs://my-app-assets-prod \
  --member=allUsers \
  --role=roles/storage.objectViewer
# バージョニングを有効にする
gcloud storage buckets update gs://my-app-assets-prod --versioning

オブジェクト操作

# ファイルをアップロード
gcloud storage cp ./build/app.zip gs://my-app-assets-prod/releases/v1.2.0/app.zip
# ディレクトリを同期
gcloud storage rsync ./dist gs://my-app-assets-prod/static/ \
  --delete-unmatched-destination-objects \
  --cache-control="public, max-age=86400"
# バケット間でコピー
gcloud storage cp gs://source-bucket/data.csv gs://dest-bucket/data.csv
# プレフィックス付きのオブジェクトをリスト表示
gcloud storage ls gs://my-app-assets-prod/releases/ --recursive
# オブジェクトを削除
gcloud storage rm gs://my-app-assets-prod/old-file.txt

Signed URLs

# ダウンロード用の署名付き URL を生成 (1 時間)
from google.cloud import storage
from datetime import timedelta

client = storage.Client()
bucket = client.bucket('my-app-assets-prod')
blob = bucket.blob('reports/q4.pdf')

url = blob.generate_signed_url(
    version='v4',
    expiration=timedelta(hours=1),
    method='GET'
)
print(f"Download URL: {url}")
# アップロード用の署名付き URL を生成
url = blob.generate_signed_url(
    version='v4',
    expiration=timedelta(minutes=15),
    method='PUT',
    content_type='application/octet-stream'
)
print(f"Upload URL: {url}")
# Client uploads with: curl -X PUT -H "Content-Type: application/octet-stream" --data-binary @file "$url"
# gsutil で署名付き URL を生成
gcloud storage sign-url gs://my-app-assets-prod/reports/q4.pdf \
  --duration=1h \
  --private-key-file=service-account.json

ライフサイクルルール

// lifecycle-config.json — オブジェクトを自動的に移行および期限切れにする
{
  "rule": [
    {
      "action": {"type": "SetStorageClass", "storageClass": "NEARLINE"},
      "condition": {"age": 30, "matchesPrefix": ["logs/"]}
    },
    {
      "action": {"type": "SetStorageClass", "storageClass": "COLDLINE"},
      "condition": {"age": 90, "matchesPrefix": ["logs/"]}
    },
    {
      "action": {"type": "Delete"},
      "condition": {"age": 365, "matchesPrefix": ["logs/"]}
    },
    {
      "action": {"type": "AbortIncompleteMultipartUpload"},
      "condition": {"age": 7}
    },
    {
      "action": {"type": "Delete"},
      "condition": {"numNewerVersions": 3, "isLive": false}
    }
  ]
}
# ライフサイクルルールを適用
gcloud storage buckets update gs://my-app-assets-prod \
  --lifecycle-file=lifecycle-config.json

静的ウェブサイトのホスティング

# 静的ウェブサイト用にバケットを構成
gcloud storage buckets update gs://my-app-website \
  --web-main-page-suffix=index.html \
  --web-not-found-page=404.html
# 適切なコンテンツタイプでウェブサイトファイルをアップロード
gcloud storage cp -r ./build/* gs://my-app-website/ \
  --cache-control="public, max-age=3600"

イベント通知

# オブジェクトが作成されたときに Pub/Sub に通知
gcloud storage buckets notifications create gs://my-app-assets-prod \
  --topic=storage-events \
  --event-types=OBJECT_FINALIZE \
  --object-prefix=uploads/

CORS 構成

// cors-config.json — ブラウザのアップロードを許可
[
  {
    "origin": ["https://myapp.com"],
    "method": ["GET", "PUT", "POST"],
    "responseHeader": ["Content-Type"],
    "maxAgeSeconds": 3600
  }
]
# CORS を適用
gcloud storage buckets update gs://my-app-assets-prod --cors-file=cors-config.json

アクセス制御

# サービスアカウントに読み取りアクセス権を付与
gcloud storage buckets add-iam-policy-binding gs://my-app-assets-prod \
  --member=serviceAccount:app@my-project.iam.gserviceaccount.com \
  --role=roles/storage.objectViewer
# パブリックアクセスを削除
gcloud storage buckets remove-iam-policy-binding gs://my-app-assets-prod \
  --member=allUsers \
  --role=roles/storage.objectViewer

ベストプラクティス

  • よりシンプルな権限のために、均一なバケットレベルアクセス(ACL を無効化)を有効にする
  • ライフサイクルルールを使用して、コールドデータをより安価なクラスに自動的に移行する
  • オブジェクトを公開する代わりに、一時的なアクセスのために署名付き URL を生成する
  • 重要なデータを含むバケットでバージョニングを有効にする
  • 効率的なディレクトリ同期のために gcloud storage rsync を使用する
  • CDN およびブラウザのキャッシュのために適切な Cache-Control ヘッダーを設定する
  • アップロードのイベント駆動型処理のために Pub/Sub 通知を使用する
  • 保存されるバージョンを制限するために、オブジェクトバージョニング + ライフサイクルルールを有効にする
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

GCP Cloud Storage

Google Cloud Storage is a unified object storage service with global edge caching. It offers multiple storage classes (Standard, Nearline, Coldline, Archive) for cost optimization, strong consistency, and integration with all GCP services.

Core Concepts

  • Bucket — globally unique container, scoped to a project and location
  • Object — a file with metadata, identified by name (path) within a bucket
  • Storage Class — Standard, Nearline (30d), Coldline (90d), Archive (365d)
  • Signed URL — time-limited URL for authenticated access without credentials
  • Lifecycle Rule — automatic actions based on age, class, or conditions
  • IAM / ACL — access control at bucket and object level

Bucket Operations

# Create a bucket with location and default storage class
gcloud storage buckets create gs://my-app-assets-prod \
  --location=us-central1 \
  --default-storage-class=STANDARD \
  --uniform-bucket-level-access
# List buckets
gcloud storage ls
# Set bucket to public read (for static hosting)
gcloud storage buckets add-iam-policy-binding gs://my-app-assets-prod \
  --member=allUsers \
  --role=roles/storage.objectViewer
# Enable versioning
gcloud storage buckets update gs://my-app-assets-prod --versioning

Object Operations

# Upload a file
gcloud storage cp ./build/app.zip gs://my-app-assets-prod/releases/v1.2.0/app.zip
# Sync a directory
gcloud storage rsync ./dist gs://my-app-assets-prod/static/ \
  --delete-unmatched-destination-objects \
  --cache-control="public, max-age=86400"
# Copy between buckets
gcloud storage cp gs://source-bucket/data.csv gs://dest-bucket/data.csv
# List objects with prefix
gcloud storage ls gs://my-app-assets-prod/releases/ --recursive
# Remove objects
gcloud storage rm gs://my-app-assets-prod/old-file.txt

Signed URLs

# Generate signed URL for download (1 hour)
from google.cloud import storage
from datetime import timedelta

client = storage.Client()
bucket = client.bucket('my-app-assets-prod')
blob = bucket.blob('reports/q4.pdf')

url = blob.generate_signed_url(
    version='v4',
    expiration=timedelta(hours=1),
    method='GET'
)
print(f"Download URL: {url}")
# Generate signed URL for upload
url = blob.generate_signed_url(
    version='v4',
    expiration=timedelta(minutes=15),
    method='PUT',
    content_type='application/octet-stream'
)
print(f"Upload URL: {url}")
# Client uploads with: curl -X PUT -H "Content-Type: application/octet-stream" --data-binary @file "$url"
# Generate signed URL with gsutil
gcloud storage sign-url gs://my-app-assets-prod/reports/q4.pdf \
  --duration=1h \
  --private-key-file=service-account.json

Lifecycle Rules

// lifecycle-config.json — transition and expire objects automatically
{
  "rule": [
    {
      "action": {"type": "SetStorageClass", "storageClass": "NEARLINE"},
      "condition": {"age": 30, "matchesPrefix": ["logs/"]}
    },
    {
      "action": {"type": "SetStorageClass", "storageClass": "COLDLINE"},
      "condition": {"age": 90, "matchesPrefix": ["logs/"]}
    },
    {
      "action": {"type": "Delete"},
      "condition": {"age": 365, "matchesPrefix": ["logs/"]}
    },
    {
      "action": {"type": "AbortIncompleteMultipartUpload"},
      "condition": {"age": 7}
    },
    {
      "action": {"type": "Delete"},
      "condition": {"numNewerVersions": 3, "isLive": false}
    }
  ]
}
# Apply lifecycle rules
gcloud storage buckets update gs://my-app-assets-prod \
  --lifecycle-file=lifecycle-config.json

Static Website Hosting

# Configure bucket for static website
gcloud storage buckets update gs://my-app-website \
  --web-main-page-suffix=index.html \
  --web-not-found-page=404.html
# Upload website files with appropriate content types
gcloud storage cp -r ./build/* gs://my-app-website/ \
  --cache-control="public, max-age=3600"

Event Notifications

# Notify Pub/Sub when objects are created
gcloud storage buckets notifications create gs://my-app-assets-prod \
  --topic=storage-events \
  --event-types=OBJECT_FINALIZE \
  --object-prefix=uploads/

CORS Configuration

// cors-config.json — allow browser uploads
[
  {
    "origin": ["https://myapp.com"],
    "method": ["GET", "PUT", "POST"],
    "responseHeader": ["Content-Type"],
    "maxAgeSeconds": 3600
  }
]
# Apply CORS
gcloud storage buckets update gs://my-app-assets-prod --cors-file=cors-config.json

Access Control

# Grant a service account read access
gcloud storage buckets add-iam-policy-binding gs://my-app-assets-prod \
  --member=serviceAccount:app@my-project.iam.gserviceaccount.com \
  --role=roles/storage.objectViewer
# Remove public access
gcloud storage buckets remove-iam-policy-binding gs://my-app-assets-prod \
  --member=allUsers \
  --role=roles/storage.objectViewer

Best Practices

  • Enable uniform bucket-level access (disable ACLs) for simpler permissions
  • Use lifecycle rules to automatically transition cold data to cheaper classes
  • Generate signed URLs for temporary access instead of making objects public
  • Enable versioning on buckets with critical data
  • Use gcloud storage rsync for efficient directory synchronization
  • Set appropriate Cache-Control headers for CDN and browser caching
  • Use Pub/Sub notifications for event-driven processing of uploads
  • Enable Object Versioning + lifecycle rules to limit stored versions