Skip to contents

Amazon Simple Storage Service

Usage

s3(config = list(), credentials = list(), endpoint = NULL, region = NULL)

Arguments

config

Optional configuration of credentials, endpoint, and/or region.

  • credentials:

    • creds:

      • access_key_id: AWS access key ID

      • secret_access_key: AWS secret access key

      • session_token: AWS temporary session token

    • profile: The name of a profile to use. If not given, then the default profile is used.

    • anonymous: Set anonymous credentials.

  • endpoint: The complete URL to use for the constructed client.

  • region: The AWS Region used in instantiating the client.

  • close_connection: Immediately close all HTTP connections.

  • timeout: The time in seconds till a timeout exception is thrown when attempting to make a connection. The default is 60 seconds.

  • s3_force_path_style: Set this to true to force the request to use path-style addressing, i.e. http://s3.amazonaws.com/BUCKET/KEY.

  • sts_regional_endpoint: Set sts regional endpoint resolver to regional or legacy https://docs.aws.amazon.com/sdkref/latest/guide/feature-sts-regionalized-endpoints.html

credentials

Optional credentials shorthand for the config parameter

  • creds:

    • access_key_id: AWS access key ID

    • secret_access_key: AWS secret access key

    • session_token: AWS temporary session token

  • profile: The name of a profile to use. If not given, then the default profile is used.

  • anonymous: Set anonymous credentials.

endpoint

Optional shorthand for complete URL to use for the constructed client.

region

Optional shorthand for AWS Region used in instantiating the client.

Value

A client for the service. You can call the service's operations using syntax like svc$operation(...), where svc is the name you've assigned to the client. The available operations are listed in the Operations section.

Service syntax

svc <- s3(
  config = list(
    credentials = list(
      creds = list(
        access_key_id = "string",
        secret_access_key = "string",
        session_token = "string"
      ),
      profile = "string",
      anonymous = "logical"
    ),
    endpoint = "string",
    region = "string",
    close_connection = "logical",
    timeout = "numeric",
    s3_force_path_style = "logical",
    sts_regional_endpoint = "string"
  ),
  credentials = list(
    creds = list(
      access_key_id = "string",
      secret_access_key = "string",
      session_token = "string"
    ),
    profile = "string",
    anonymous = "logical"
  ),
  endpoint = "string",
  region = "string"
)

Operations

abort_multipart_uploadThis operation aborts a multipart upload
complete_multipart_uploadCompletes a multipart upload by assembling previously uploaded parts
copy_objectCreates a copy of an object that is already stored in Amazon S3
create_bucketThis action creates an Amazon S3 bucket
create_bucket_metadata_configurationCreates an S3 Metadata V2 metadata configuration for a general purpose bucket
create_bucket_metadata_table_configurationWe recommend that you create your S3 Metadata configurations by using the V2 CreateBucketMetadataConfiguration API operation
create_multipart_uploadEnd of support notice: As of October 1, 2025, Amazon S3 has discontinued support for Email Grantee Access Control Lists (ACLs)
create_sessionCreates a session that establishes temporary security credentials to support fast authentication and authorization for the Zonal endpoint API operations on directory buckets
delete_bucketDeletes the S3 bucket
delete_bucket_analytics_configurationThis operation is not supported for directory buckets
delete_bucket_corsThis operation is not supported for directory buckets
delete_bucket_encryptionThis implementation of the DELETE action resets the default encryption for the bucket as server-side encryption with Amazon S3 managed keys (SSE-S3)
delete_bucket_intelligent_tiering_configurationThis operation is not supported for directory buckets
delete_bucket_inventory_configurationDeletes an S3 Inventory configuration (identified by the inventory ID) from the bucket
delete_bucket_lifecycleDeletes the lifecycle configuration from the specified bucket
delete_bucket_metadata_configurationDeletes an S3 Metadata configuration from a general purpose bucket
delete_bucket_metadata_table_configurationWe recommend that you delete your S3 Metadata configurations by using the V2 DeleteBucketMetadataTableConfiguration API operation
delete_bucket_metrics_configurationDeletes a metrics configuration for the Amazon CloudWatch request metrics (specified by the metrics configuration ID) from the bucket
delete_bucket_ownership_controlsThis operation is not supported for directory buckets
delete_bucket_policyDeletes the policy of a specified bucket
delete_bucket_replicationThis operation is not supported for directory buckets
delete_bucket_taggingThis operation is not supported for directory buckets
delete_bucket_websiteThis operation is not supported for directory buckets
delete_objectRemoves an object from a bucket
delete_objectsThis operation enables you to delete multiple objects from a bucket using a single HTTP request
delete_object_taggingThis operation is not supported for directory buckets
delete_public_access_blockThis operation is not supported for directory buckets
download_fileDownload a file from S3 and store it at a specified file location
generate_presigned_url@title Generate a presigned url given a client, its method, and arguments
get_bucket_abacReturns the attribute-based access control (ABAC) property of the general purpose bucket
get_bucket_accelerate_configurationThis operation is not supported for directory buckets
get_bucket_aclThis operation is not supported for directory buckets
get_bucket_analytics_configurationThis operation is not supported for directory buckets
get_bucket_corsThis operation is not supported for directory buckets
get_bucket_encryptionReturns the default encryption configuration for an Amazon S3 bucket
get_bucket_intelligent_tiering_configurationThis operation is not supported for directory buckets
get_bucket_inventory_configurationReturns an S3 Inventory configuration (identified by the inventory configuration ID) from the bucket
get_bucket_lifecycleFor an updated version of this API, see GetBucketLifecycleConfiguration
get_bucket_lifecycle_configurationReturns the lifecycle configuration information set on the bucket
get_bucket_locationUsing the GetBucketLocation operation is no longer a best practice
get_bucket_loggingThis operation is not supported for directory buckets
get_bucket_metadata_configurationRetrieves the S3 Metadata configuration for a general purpose bucket
get_bucket_metadata_table_configurationWe recommend that you retrieve your S3 Metadata configurations by using the V2 GetBucketMetadataTableConfiguration API operation
get_bucket_metrics_configurationGets a metrics configuration (specified by the metrics configuration ID) from the bucket
get_bucket_notificationThis operation is not supported for directory buckets
get_bucket_notification_configurationThis operation is not supported for directory buckets
get_bucket_ownership_controlsThis operation is not supported for directory buckets
get_bucket_policyReturns the policy of a specified bucket
get_bucket_policy_statusThis operation is not supported for directory buckets
get_bucket_replicationThis operation is not supported for directory buckets
get_bucket_request_paymentThis operation is not supported for directory buckets
get_bucket_taggingThis operation is not supported for directory buckets
get_bucket_versioningThis operation is not supported for directory buckets
get_bucket_websiteThis operation is not supported for directory buckets
get_objectRetrieves an object from Amazon S3
get_object_aclThis operation is not supported for directory buckets
get_object_attributesRetrieves all of the metadata from an object without returning the object itself
get_object_legal_holdThis operation is not supported for directory buckets
get_object_lock_configurationThis operation is not supported for directory buckets
get_object_retentionThis operation is not supported for directory buckets
get_object_taggingThis operation is not supported for directory buckets
get_object_torrentThis operation is not supported for directory buckets
get_public_access_blockThis operation is not supported for directory buckets
head_bucketYou can use this operation to determine if a bucket exists and if you have permission to access it
head_objectThe HEAD operation retrieves metadata from an object without returning the object itself
list_bucket_analytics_configurationsThis operation is not supported for directory buckets
list_bucket_intelligent_tiering_configurationsThis operation is not supported for directory buckets
list_bucket_inventory_configurationsReturns a list of S3 Inventory configurations for the bucket
list_bucket_metrics_configurationsLists the metrics configurations for the bucket
list_bucketsThis operation is not supported for directory buckets
list_directory_bucketsReturns a list of all Amazon S3 directory buckets owned by the authenticated sender of the request
list_multipart_uploadsThis operation lists in-progress multipart uploads in a bucket
list_objectsThis operation is not supported for directory buckets
list_objects_v2Returns some or all (up to 1,000) of the objects in a bucket with each request
list_object_versionsThis operation is not supported for directory buckets
list_partsLists the parts that have been uploaded for a specific multipart upload
put_bucket_abacSets the attribute-based access control (ABAC) property of the general purpose bucket
put_bucket_accelerate_configurationThis operation is not supported for directory buckets
put_bucket_aclEnd of support notice: As of October 1, 2025, Amazon S3 has discontinued support for Email Grantee Access Control Lists (ACLs)
put_bucket_analytics_configurationThis operation is not supported for directory buckets
put_bucket_corsThis operation is not supported for directory buckets
put_bucket_encryptionThis operation configures default encryption and Amazon S3 Bucket Keys for an existing bucket
put_bucket_intelligent_tiering_configurationThis operation is not supported for directory buckets
put_bucket_inventory_configurationThis implementation of the PUT action adds an S3 Inventory configuration (identified by the inventory ID) to the bucket
put_bucket_lifecycleThis operation is not supported for directory buckets
put_bucket_lifecycle_configurationCreates a new lifecycle configuration for the bucket or replaces an existing lifecycle configuration
put_bucket_loggingEnd of support notice: As of October 1, 2025, Amazon S3 has discontinued support for Email Grantee Access Control Lists (ACLs)
put_bucket_metrics_configurationSets a metrics configuration (specified by the metrics configuration ID) for the bucket
put_bucket_notificationThis operation is not supported for directory buckets
put_bucket_notification_configurationThis operation is not supported for directory buckets
put_bucket_ownership_controlsThis operation is not supported for directory buckets
put_bucket_policyApplies an Amazon S3 bucket policy to an Amazon S3 bucket
put_bucket_replicationThis operation is not supported for directory buckets
put_bucket_request_paymentThis operation is not supported for directory buckets
put_bucket_taggingThis operation is not supported for directory buckets
put_bucket_versioningThis operation is not supported for directory buckets
put_bucket_websiteThis operation is not supported for directory buckets
put_objectEnd of support notice: As of October 1, 2025, Amazon S3 has discontinued support for Email Grantee Access Control Lists (ACLs)
put_object_aclEnd of support notice: As of October 1, 2025, Amazon S3 has discontinued support for Email Grantee Access Control Lists (ACLs)
put_object_legal_holdThis operation is not supported for directory buckets
put_object_lock_configurationThis operation is not supported for directory buckets
put_object_retentionThis operation is not supported for directory buckets
put_object_taggingThis operation is not supported for directory buckets
put_public_access_blockThis operation is not supported for directory buckets
rename_objectRenames an existing object in a directory bucket that uses the S3 Express One Zone storage class
restore_objectThis operation is not supported for directory buckets
select_object_contentThis operation is not supported for directory buckets
update_bucket_metadata_inventory_table_configurationEnables or disables a live inventory table for an S3 Metadata configuration on a general purpose bucket
update_bucket_metadata_journal_table_configurationEnables or disables journal table record expiration for an S3 Metadata configuration on a general purpose bucket
update_object_encryptionThis operation is not supported for directory buckets or Amazon S3 on Outposts buckets
upload_partUploads a part in a multipart upload
upload_part_copyUploads a part by copying data from an existing object as data source
write_get_object_responseThis operation is not supported for directory buckets

Examples

if (FALSE) { # \dontrun{
svc <- s3()
# The following example aborts a multipart upload.
svc$abort_multipart_upload(
  Bucket = "examplebucket",
  Key = "bigobject",
  UploadId = "xadcOB_7YPBOJuoFiQ9cz4P3Pe6FIZwO4f7wN93uHsNBEw97pl5eNwzExg0LA..."
)
} # }