Return an API service object with information and handlers needed to make API requests.
Region and credentials
new_service requires that you've set your AWS region in one of:
AWS_REGIONR environment variableAWS_REGIONOS environment variable (Linux and macOS)~/.aws/configAWS configuration file
new_service also requires that you've set your AWS credentials in one of:
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYR environment variablesAWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYOS environment variables (Linux and macOS)~/.aws/credentialsAWS credentials fileIAM role
See also
Other API request functions:
new_handlers(),
new_operation(),
new_request(),
send_request()
Examples
if (FALSE) { # \dontrun{
# Metadata for the S3 API.
metadata <- list(
service_name = "s3",
endpoints = list("us-east-1" = list(endpoint = "s3.amazonaws.com", global = FALSE)),
service_id = "S3",
api_version = "2006-03-01",
signing_name = NULL,
json_version = "",
target_prefix = ""
)
# Handlers for S3.
handlers <- new_handlers("restxml", "v4")
# Build a service object for S3, containing the information necessary to
# build, send, and receive requests.
service <- new_service(metadata, handlers)
} # }