79829150

Date: 2025-11-24 22:05:00
Score: 0.5
Natty:
Report link

Lightsail bucket now support CORS configuration through AWS CLI:

To configure CORS for a bucket using the AWS CLI
  1. Create a JSON file containing your CORS configuration. For example, create a file named cors-config.json with the following content:

    {
      "CORSRules": [
        {
          "AllowedOrigins": ["https://example.com"],
          "AllowedMethods": ["GET", "PUT", "POST"],
          "AllowedHeaders": ["*"],
          "MaxAgeSeconds": 3000
        }
      ]
    }
    
    
  2. Use the AWS CLI to apply the CORS configuration to your bucket:

    aws lightsail update-bucket --bucket-name amzn-s3-demo-bucket --cors file://cors-config.json

  3. Verify the CORS configuration was applied successfully:

    aws lightsail get-buckets --bucket-name amzn-s3-demo-bucket --include-cors

please refer to: https://docs.aws.amazon.com/en_us/lightsail/latest/userguide/configure-cors.html

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Joy