set_config: Add configuration settings to a service object.

View source: R/config.R

set_configR Documentation

Add configuration settings to a service object.

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

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:

list(
  credentials = list(
    creds = list(
      access_key_id = "string",
      secret_access_key = "string",
      session_token = "string"
    ),
    profile = "string"
  ),
  endpoint = "string",
  region = "string"
)

Examples

# 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 Oct. 4, 2024, 1:08 a.m.