:doc:`DataSync <../../datasync>` / Client / create_location_s3

******************
create_location_s3
******************



.. py:method:: DataSync.Client.create_location_s3(**kwargs)

  

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

   

  .. warning::

     

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

     

    
    * `Storage class considerations with Amazon S3 locations <https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#using-storage-classes>`__
     
    * `Evaluating S3 request costs when using DataSync <https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#create-s3-location-s3-requests>`__
    

     

   

  For more information, see `Configuring transfers with Amazon S3 <https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/CreateLocationS3>`_  


  **Request Syntax**
  ::

    response = client.create_location_s3(
        Subdirectory='string',
        S3BucketArn='string',
        S3StorageClass='STANDARD'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_INSTANT_RETRIEVAL',
        S3Config={
            'BucketAccessRoleArn': 'string'
        },
        AgentArns=[
            'string',
        ],
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    )
    
  :type Subdirectory: string
  :param Subdirectory: 

    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).

     

    .. note::

      

      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``
      

      

    

  
  :type S3BucketArn: string
  :param S3BucketArn: **[REQUIRED]** 

    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 <https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html>`__ in the *Amazon S3 User Guide*.

    

  
  :type S3StorageClass: string
  :param S3StorageClass: 

    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 <https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#using-storage-classes>`__.

    

  
  :type S3Config: dict
  :param S3Config: **[REQUIRED]** 

    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 `Providing DataSync access to S3 buckets <https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#create-s3-location-access>`__.

    

  
    - **BucketAccessRoleArn** *(string) --* **[REQUIRED]** 

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

      

    
  
  :type AgentArns: list
  :param AgentArns: 

    (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 <https://docs.aws.amazon.com/datasync/latest/userguide/deploy-agents.html#outposts-agent>`__.

    

  
    - *(string) --* 

    

  :type Tags: list
  :param Tags: 

    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.

        

      
    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'LocationArn': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      CreateLocationS3Response

      
      

      - **LocationArn** *(string) --* 

        The ARN of the S3 location that you created.

        
  
  **Exceptions**
  
  *   :py:class:`DataSync.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`DataSync.Client.exceptions.InternalException`

  