Pin data to an S3 bucket, such as on Amazon's S3 service or MinIO, using the paws.storage package.
board_s3( bucket, prefix = NULL, versioned = TRUE, access_key = NULL, secret_access_key = NULL, session_token = NULL, credential_expiration = NULL, profile = NULL, region = NULL, endpoint = NULL, cache = NULL )
Bucket name. You can only write to an existing bucket.
Prefix within this bucket that this board will occupy.
You can use this to maintain multiple independent pin boards within
a single S3 bucket. Will typically end with
Should this board be registered with support for versions?
Manually control authentication. See documentation below for details.
Role to use from AWS shared credentials/config file.
AWS region. If not specified, will be read from
Endpoint to use; usually generated automatically for AWS
Cache path. Every board requires a local cache to avoid downloading files multiple times. The default stores in a standard cache location for your operating system, but you can override if needed.
board_s3() is powered by the paws package which provides a wide range
of authentication options, as documented at
In brief, there are four main options that are tried in order:
secret_access_key arguments to this function.
If you have a temporary session token, you'll also need to supply
(Not recommended since your
secret_access_key will be recorded
AWS_SECRET_ACCESS_KEY env vars.
AWS_CREDENTIAL_EXPIRATION env vars if you
have a temporary session token)
The AWS shared credential file,
[profile-name] aws_access_key_id=your AWS access key aws_secret_access_key=your AWS secret key
The "default" profile will be used if you don't supply the access key
and secret access key as described above. Otherwise you can use the
profile argument to use a profile of your choice.
Automatic authentication from EC2 instance or container IAM role.
See the paws documentation for more unusual options including getting credentials from a command line process, picking a role when running inside an EC2 instance, using a role from another profile, and using multifactor authentication.
The functions in pins do not create a new bucket. You can create a new bucket from R with paws.
Some functions like
pin_list() will work for an S3 board, but don't
return useful output.
You can pass arguments for paws.storage::s3_put_object such as
ServerSideEncryption through the dots of
board_s3() is powered by the paws.storage package, which is a
suggested dependency of pins (not required for pins in general). If
you run into errors when deploying content to a server like
https://www.shinyapps.io or Connect,
library(paws.storage) to your app or document for automatic dependency discovery.
## Not run: board <- board_s3("pins-test-hadley", region = "us-east-2") board %>% pin_write(mtcars) board %>% pin_read("mtcars") # A prefix allows you to have multiple independent boards in the same pin. board_sales <- board_s3("company-pins", prefix = "sales/") board_marketing <- board_s3("company-pins", prefix = "marketing/") # You can make the hierarchy arbitrarily deep. # Pass arguments like `Tagging` through the dots of `pin_write`: board %>% pin_write(mtcars, Tagging = "key1=value1&key2=value2") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.