Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cloud-storage.md #9

Merged
merged 2 commits into from
Nov 17, 2023
Merged

Update cloud-storage.md #9

merged 2 commits into from
Nov 17, 2023

Conversation

raphaellaude
Copy link
Contributor

Hit this snag re: formatting of cors.json file going through the docs! TY!

@bdon
Copy link
Member

bdon commented Nov 16, 2023

Where are you inputting the value with CORSRules as a key? The formatting should be as-is for setting CORS through the S3 Bucket Permissions UI (screenshot)
Screenshot 2023-11-16 at 07 38 49

@raphaellaude
Copy link
Contributor Author

raphaellaude commented Nov 16, 2023

Ah, all makes sense. I was doing it with the aws s3api CLI:

$ aws s3api put-bucket-cors --bucket pluto-hist --cors-configuration file://cors.json


Error parsing parameter '--cors-configuration': Invalid JSON:
[
    {
        "AllowedHeaders": ["Range"],
        "AllowedMethods": ["GET","HEAD"],
        "AllowedOrigins": ["http://localhost:5173/"],
        "ExposeHeaders": ["ETag"]
    }
]

Where this worked:

$ cat cors.json
{
  "CORSRules": [
    {
        "AllowedHeaders": ["Range"],
        "AllowedMethods": ["GET","HEAD"],
        "AllowedOrigins": ["http://localhost:5173/"],
        "ExposeHeaders": ["ETag"]
    }
  ]
}
$ aws s3api put-bucket-cors --bucket pluto-hist --cors-configuration file://cors.json

I can add a note explaining the two different approaches.

@bdon bdon merged commit a124084 into protomaps:main Nov 17, 2023
1 check passed
@bdon
Copy link
Member

bdon commented Nov 17, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants