Bucket CORS configuration - Boto3 1.34.87 documentation
# Define the configuration rulescors_configuration = { 'CORSRules': [{ 'AllowedHeaders': ['Authorization'], 'AllowedMethods': ['GET', 'PUT'], 'AllowedOrigins': ['*'], 'ExposeHeaders': ['ETag', 'x-amz-request-id'], 'MaxAgeSeconds': 3000 }]}# Set the CORS configurations3 = boto3.client('s3')s3.put_bucket_cors(Bucket='BUCKET_NAME', CORSConfiguration=cors_configuration)