--- title: "put-bucket-cors" slug: "put-bucket-cors" updated: 2026-10-08T09:47:33Z published: 2026-10-08T09:47:33Z canonical: "cli.ncloud-docs.com/put-bucket-cors" --- > ## Documentation Index > Fetch the complete documentation index at: https://cli.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # put-bucket-cors Classic/VPC環境で利用できます。 Ncloud Storageバケットに Cross-origin Resource Sharing(CORS)設定を登録するか、既存の設定を上書きします。 参考 Sub Accountユーザーがこのコマンドを実行するには、Change/PutBucketCORSアクションの権限が必要です。 ## 構文 `put-bucket-cors`構文は次の通りです。 ``` aws s3api put-bucket-cors \ --bucket \ --cors-configuration \ --endpoint-url ``` ## オプション `put-bucket-cors`の実行時に指定できるオプションについて説明します。 ### 必須オプション `put-bucket-cors`の必須オプションです。 | オプション | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `--bucket` | String | Required | バケット名 | | `--cors-configuration` | String | Required | CORS設定 - `CORSRules`リストにルールを含めて指定 - 最大100個のルールを設定可能 | ### 共通オプション `aws`コマンドで共通して使用するオプションについては、[Ncloud Storageのオプション](/docs/ja/storage-ncloudstorage#%EC%98%B5%EC%85%98)をご参照ください。 ## 例 CORSルールの設定リクエストが成功すると、ルールが適用され、結果は出力されません。 ### コマンド コマンドの例は次の通りです。 ``` aws s3api put-bucket-cors --bucket my-test-bucket \ --cors-configuration file://cors.json \ --endpoint-url=https://kr.ncloudstorage.com ``` ## 関連コマンド 関連コマンドは次の通りです。 - [get-bucket-cors](/docs/ja/get-bucket-cors) - [delete-bucket-cors](/docs/ja/delete-bucket-cors)