DataSync / Client / create_location_s3



Creates a transfer location for an Amazon S3 bucket. DataSync can use this location as a source or destination for transferring data.


Before you begin, make sure that you read the following topics:

For more information, see Configuring transfers with Amazon S3.

See also: AWS API Documentation

Request Syntax

response = client.create_location_s3(
        'BucketAccessRoleArn': 'string'
            'Key': 'string',
            'Value': 'string'
  • Subdirectory (string) –

    Specifies a prefix in the S3 bucket that DataSync reads from or writes to (depending on whether the bucket is a source or destination location).


    DataSync can’t transfer objects with a prefix that begins with a slash ( /) or includes //, /./, or /../ patterns. For example:

    • /photos

    • photos//2006/January

    • photos/./2006/February

    • photos/../2006/March

  • S3BucketArn (string) –


    Specifies the ARN of the S3 bucket that you want to use as a location. (When creating your DataSync task later, you specify whether this location is a transfer source or destination.)

    If your S3 bucket is located on an Outposts resource, you must specify an Amazon S3 access point. For more information, see Managing data access with Amazon S3 access points in the Amazon S3 User Guide.

  • S3StorageClass (string) –

    Specifies the storage class that you want your objects to use when Amazon S3 is a transfer destination.

    For buckets in Amazon Web Services Regions, the storage class defaults to STANDARD. For buckets on Outposts, the storage class defaults to OUTPOSTS.

    For more information, see Storage class considerations with Amazon S3 transfers.

  • S3Config (dict) –


    Specifies the Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that DataSync uses to access your S3 bucket.

    For more information, see Accessing S3 buckets.

    • BucketAccessRoleArn (string) – [REQUIRED]

      Specifies the ARN of the IAM role that DataSync uses to access your S3 bucket.

  • AgentArns (list) –

    (Amazon S3 on Outposts only) Specifies the Amazon Resource Name (ARN) of the DataSync agent on your Outpost.

    For more information, see Deploy your DataSync agent on Outposts.

    • (string) –

  • Tags (list) –

    Specifies labels that help you categorize, filter, and search for your Amazon Web Services resources. We recommend creating at least a name tag for your transfer location.

    • (dict) –

      A key-value pair representing a single tag that’s been applied to an Amazon Web Services resource.

      • Key (string) – [REQUIRED]

        The key for an Amazon Web Services resource tag.

      • Value (string) –

        The value for an Amazon Web Services resource tag.

Return type:



Response Syntax

    'LocationArn': 'string'

Response Structure

  • (dict) –


    • LocationArn (string) –

      The ARN of the S3 location that you created.


  • DataSync.Client.exceptions.InvalidRequestException

  • DataSync.Client.exceptions.InternalException