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

************
create_agent
************



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

  

  Activates an DataSync agent that you deploy in your storage environment. The activation process associates the agent with your Amazon Web Services account.

   

  If you haven't deployed an agent yet, see `Do I need a DataSync agent? <https://docs.aws.amazon.com/datasync/latest/userguide/do-i-need-datasync-agent.html>`__

  

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


  **Request Syntax**
  ::

    response = client.create_agent(
        ActivationKey='string',
        AgentName='string',
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        VpcEndpointId='string',
        SubnetArns=[
            'string',
        ],
        SecurityGroupArns=[
            'string',
        ]
    )
    
  :type ActivationKey: string
  :param ActivationKey: **[REQUIRED]** 

    Specifies your DataSync agent's activation key. If you don't have an activation key, see `Activating your agent <https://docs.aws.amazon.com/datasync/latest/userguide/activate-agent.html>`__.

    

  
  :type AgentName: string
  :param AgentName: 

    Specifies a name for your agent. We recommend specifying a name that you can remember.

    

  
  :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 one tag for your agent.

    

  
    - *(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.

        

      
    

  :type VpcEndpointId: string
  :param VpcEndpointId: 

    Specifies the ID of the `VPC service endpoint <https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#datasync-in-vpc>`__ that you're using. For example, a VPC endpoint ID looks like ``vpce-01234d5aff67890e1``.

     

    .. warning::

       

      The VPC service endpoint you use must include the DataSync service name (for example, ``com.amazonaws.us-east-2.datasync``).

      

    

  
  :type SubnetArns: list
  :param SubnetArns: 

    Specifies the ARN of the subnet where your VPC service endpoint is located. You can only specify one ARN.

    

  
    - *(string) --* 

    

  :type SecurityGroupArns: list
  :param SecurityGroupArns: 

    Specifies the Amazon Resource Name (ARN) of the security group that allows traffic between your agent and VPC service endpoint. You can only specify one ARN.

    

  
    - *(string) --* 

    

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

    
    ::

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

    

    - *(dict) --* 

      CreateAgentResponse

      
      

      - **AgentArn** *(string) --* 

        The ARN of the agent that you just activated. Use the `ListAgents <https://docs.aws.amazon.com/datasync/latest/userguide/API_ListAgents.html>`__ operation to return a list of agents in your Amazon Web Services account and Amazon Web Services Region.

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

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

  