board_s3: Use an S3 bucket as a board

Description Usage Arguments Authentication Caveats Examples

View source: R/board_s3.R

Description

Pin data to a bucket on Amazon's S3 service, using the paws.storage package.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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
)

Arguments

bucket

Bucket name.

prefix

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 / to take advantage of S3's directory-like handling.

versioned

Should this board be registered with support for versions?

access_key, secret_access_key, session_token, credential_expiration

Manually control authentication. See documentation below for details.

profile

Role to use from AWS shared credentials/config file.

region

AWS region. If not specified, will be read from AWS_REGION, or AWS config file.

endpoint

AWS endpoint to use; usually generated automatically from region.

cache

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.

Authentication

board_s3() is powered by the paws package which provides a wide range of authentication options, as documented at https://github.com/paws-r/paws/blob/main/docs/credentials.md. In brief, there are four main options that are tried in order:

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.

Caveats

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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.

## End(Not run)

pins documentation built on Oct. 2, 2021, 5:06 p.m.