Use the gsutil cors command to configure CORS on a bucket:
gsutil cors set cors-json-file.json gs://example-bucket
Where cors-json-file.json is a local file that contains:
[ { "origin": ["http://example.appspot.com"], "responseHeader": ["Content-Type"], "method": ["GET", "HEAD", "DELETE"], "maxAgeSeconds": 3600 } ]
You can also use the gsutil cors command to get the CORS configuration of a bucket:
gsutil cors get gs://example-bucket
Hope this helped!!
To know more about Google Cloud, It is recommended to go for Google Cloud Certification training today.
Thank you!