Platform
Resources
Pricing
Sign in
Get started
Templates /
AWS S3 API Starter
Sign up to use template
Observable
The end-to-end solution for building and hosting better data apps, dashboards, and reports.
Workspace
Public
3 collections
By
Ian Johnson
Edited
Oct 22, 2024
ISC
19 forks
21 stars
1
Insert cell
2
Insert cell
region
=
"us-east-1"
Insert cell
bucket
=
"pinyin"
Insert cell
Insert cell
9+
Inputs
.
table
(
contents
,
{
columns
:
[
"Key"
,
"LastModified"
,
"Owner"
,
"Size"
]
,
format
:
{
Owner
:
(
d
)
=>
d
.
DisplayName
,
Key
:
(
d
)
=>
html
`<a href="https://${
bucket
}.s3.amazonaws.com/${
d
}">${
d
}</a>`
}
}
)
Insert cell
// Either load the bucket contents or load the sample cached data
contents
=
client
?
(
await
client
.
send
(
new
AWS
.
ListObjectsCommand
(
{
Bucket
:
bucket
,
MaxKeys
:
100
}
)
)
)
.
Contents
:
FileAttachment
(
"contents.json"
)
.
json
(
)
Insert cell
Insert cell
3
AWS
=
import
(
"https://cdn.skypack.dev/@aws-sdk/client-s3@3.39.0"
)
Insert cell
client
=
{
try
{
return
new
AWS
.
S3Client
(
{
region
,
credentials
:
{
accessKeyId
:
Secret
(
"AWS_ACCESS_KEY_ID"
)
,
secretAccessKey
:
Secret
(
"AWS_SECRET_ACCESS_KEY"
)
}
}
)
}
catch
{
return
false
;
}
}
Insert cell
Insert cell
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Fork
View
Export
Listed in...
Observable for Developers
Observable
Templates: Integrations
Observable
Templates
Observable
Edit
Show 2 comments
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
region
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
bucket
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Show 20 comments
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
contents
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
AWS
Show 3 comments
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
client
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
hasAccessKeyID
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
hasSecretAccessKey
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML