:doc:`VPCLattice <../../vpc-lattice>` / Client / register_targets

****************
register_targets
****************



.. py:method:: VPCLattice.Client.register_targets(**kwargs)

  

  Registers the targets with the target group. If it's a Lambda target, you can only have one target in a target group.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/RegisterTargets>`_  


  **Request Syntax**
  ::

    response = client.register_targets(
        targetGroupIdentifier='string',
        targets=[
            {
                'id': 'string',
                'port': 123
            },
        ]
    )
    
  :type targetGroupIdentifier: string
  :param targetGroupIdentifier: **[REQUIRED]** 

    The ID or ARN of the target group.

    

  
  :type targets: list
  :param targets: **[REQUIRED]** 

    The targets.

    

  
    - *(dict) --* 

      Describes a target.

      

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

        The ID of the target. If the target group type is ``INSTANCE``, this is an instance ID. If the target group type is ``IP``, this is an IP address. If the target group type is ``LAMBDA``, this is the ARN of a Lambda function. If the target group type is ``ALB``, this is the ARN of an Application Load Balancer.

        

      
      - **port** *(integer) --* 

        The port on which the target is listening. For HTTP, the default is 80. For HTTPS, the default is 443.

        

      
    

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

    
    ::

      {
          'successful': [
              {
                  'id': 'string',
                  'port': 123
              },
          ],
          'unsuccessful': [
              {
                  'id': 'string',
                  'port': 123,
                  'failureCode': 'string',
                  'failureMessage': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **successful** *(list) --* 

        The targets that were successfully registered.

        
        

        - *(dict) --* 

          Describes a target.

          
          

          - **id** *(string) --* 

            The ID of the target. If the target group type is ``INSTANCE``, this is an instance ID. If the target group type is ``IP``, this is an IP address. If the target group type is ``LAMBDA``, this is the ARN of a Lambda function. If the target group type is ``ALB``, this is the ARN of an Application Load Balancer.

            
          

          - **port** *(integer) --* 

            The port on which the target is listening. For HTTP, the default is 80. For HTTPS, the default is 443.

            
      
    
      

      - **unsuccessful** *(list) --* 

        The targets that were not registered.

        
        

        - *(dict) --* 

          Describes a target failure.

          
          

          - **id** *(string) --* 

            The ID of the target. If the target group type is ``INSTANCE``, this is an instance ID. If the target group type is ``IP``, this is an IP address. If the target group type is ``LAMBDA``, this is the ARN of a Lambda function. If the target group type is ``ALB``, this is the ARN of an Application Load Balancer.

            
          

          - **port** *(integer) --* 

            The port on which the target is listening. This parameter doesn't apply if the target is a Lambda function.

            
          

          - **failureCode** *(string) --* 

            The failure code.

            
          

          - **failureMessage** *(string) --* 

            The failure message.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`VPCLattice.Client.exceptions.ValidationException`

  
  *   :py:class:`VPCLattice.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`VPCLattice.Client.exceptions.ConflictException`

  
  *   :py:class:`VPCLattice.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`VPCLattice.Client.exceptions.ThrottlingException`

  
  *   :py:class:`VPCLattice.Client.exceptions.ServiceQuotaExceededException`

  
  *   :py:class:`VPCLattice.Client.exceptions.InternalServerException`

  