set_config: Add configuration settings to a service object.

Description Usage Arguments Details Examples

View source: R/config.R

Description

set_config adds a given set of configuration settings in cfgs to a service object, i.e. the service object for S3. Configuration settings can include credentials, region, endpoint, etc. These configuration settings will be used whenever an operation is called from that service object.

Usage

1
set_config(svc, cfgs = list())

Arguments

svc

A service object containing service operations.

cfgs

A list of optional configuration settings.

Details

set_config explicitly makes the credentials property mutable, such that when the SDK retrieves credentials later on, it will save them in the service object. This means that credentials don't need to be fetched on each operation, only if and when the saved credentials expire.

The optional configuration settings can include the following:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
list(
  credentials = list(
    creds = list(
      access_key_id = "string",
      secret_access_key = "string",
      session_token = "string"
    ),
    profile = "string"
  ),
  endpoint = "string",
  region = "string"
)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Create a config object with custom credentials and endpoint.
config <- set_config(
  svc = list(),
  cfgs = list(
    credentials = list(
      creds = list(
        access_key_id = "abc",
        secret_access_key = "123"
      )
    ),
    endpoint = "https://foo.com"
  )
)

paws.common documentation built on Dec. 11, 2021, 10:02 a.m.