:doc:`AgentsforBedrock <../../bedrock-agent>` / Client / create_agent_alias

******************
create_agent_alias
******************



.. py:method:: AgentsforBedrock.Client.create_agent_alias(**kwargs)

  

  Creates an alias of an agent that can be used to deploy the agent.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/CreateAgentAlias>`_  


  **Request Syntax**
  ::

    response = client.create_agent_alias(
        agentId='string',
        agentAliasName='string',
        clientToken='string',
        description='string',
        routingConfiguration=[
            {
                'agentVersion': 'string',
                'provisionedThroughput': 'string'
            },
        ],
        tags={
            'string': 'string'
        }
    )
    
  :type agentId: string
  :param agentId: **[REQUIRED]** 

    The unique identifier of the agent.

    

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

    The name of the alias.

    

  
  :type clientToken: string
  :param clientToken: 

    A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see `Ensuring idempotency <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html>`__.

    This field is autopopulated if not provided.

  
  :type description: string
  :param description: 

    A description of the alias of the agent.

    

  
  :type routingConfiguration: list
  :param routingConfiguration: 

    Contains details about the routing configuration of the alias.

    

  
    - *(dict) --* 

      Contains details about the routing configuration of the alias.

      

    
      - **agentVersion** *(string) --* 

        The version of the agent with which the alias is associated.

        

      
      - **provisionedThroughput** *(string) --* 

        Information on the Provisioned Throughput assigned to an agent alias.

        

      
    

  :type tags: dict
  :param tags: 

    Any tags that you want to attach to the alias of the agent.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


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

    
    ::

      {
          'agentAlias': {
              'agentId': 'string',
              'agentAliasId': 'string',
              'agentAliasName': 'string',
              'agentAliasArn': 'string',
              'clientToken': 'string',
              'description': 'string',
              'routingConfiguration': [
                  {
                      'agentVersion': 'string',
                      'provisionedThroughput': 'string'
                  },
              ],
              'createdAt': datetime(2015, 1, 1),
              'updatedAt': datetime(2015, 1, 1),
              'agentAliasHistoryEvents': [
                  {
                      'routingConfiguration': [
                          {
                              'agentVersion': 'string',
                              'provisionedThroughput': 'string'
                          },
                      ],
                      'endDate': datetime(2015, 1, 1),
                      'startDate': datetime(2015, 1, 1)
                  },
              ],
              'agentAliasStatus': 'CREATING'|'PREPARED'|'FAILED'|'UPDATING'|'DELETING'|'DISSOCIATED',
              'failureReasons': [
                  'string',
              ],
              'aliasInvocationState': 'ACCEPT_INVOCATIONS'|'REJECT_INVOCATIONS'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **agentAlias** *(dict) --* 

        Contains details about the alias that was created.

        
        

        - **agentId** *(string) --* 

          The unique identifier of the agent.

          
        

        - **agentAliasId** *(string) --* 

          The unique identifier of the alias of the agent.

          
        

        - **agentAliasName** *(string) --* 

          The name of the alias of the agent.

          
        

        - **agentAliasArn** *(string) --* 

          The Amazon Resource Name (ARN) of the alias of the agent.

          
        

        - **clientToken** *(string) --* 

          A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see `Ensuring idempotency <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html>`__.

          
        

        - **description** *(string) --* 

          The description of the alias of the agent.

          
        

        - **routingConfiguration** *(list) --* 

          Contains details about the routing configuration of the alias.

          
          

          - *(dict) --* 

            Contains details about the routing configuration of the alias.

            
            

            - **agentVersion** *(string) --* 

              The version of the agent with which the alias is associated.

              
            

            - **provisionedThroughput** *(string) --* 

              Information on the Provisioned Throughput assigned to an agent alias.

              
        
      
        

        - **createdAt** *(datetime) --* 

          The time at which the alias of the agent was created.

          
        

        - **updatedAt** *(datetime) --* 

          The time at which the alias was last updated.

          
        

        - **agentAliasHistoryEvents** *(list) --* 

          Contains details about the history of the alias.

          
          

          - *(dict) --* 

            Contains details about the history of the alias.

            
            

            - **routingConfiguration** *(list) --* 

              Contains details about the version of the agent with which the alias is associated.

              
              

              - *(dict) --* 

                Contains details about the routing configuration of the alias.

                
                

                - **agentVersion** *(string) --* 

                  The version of the agent with which the alias is associated.

                  
                

                - **provisionedThroughput** *(string) --* 

                  Information on the Provisioned Throughput assigned to an agent alias.

                  
            
          
            

            - **endDate** *(datetime) --* 

              The date that the alias stopped being associated to the version in the ``routingConfiguration`` object

              
            

            - **startDate** *(datetime) --* 

              The date that the alias began being associated to the version in the ``routingConfiguration`` object.

              
        
      
        

        - **agentAliasStatus** *(string) --* 

          The status of the alias of the agent and whether it is ready for use. The following statuses are possible:

           

          
          * CREATING – The agent alias is being created.
           
          * PREPARED – The agent alias is finished being created or updated and is ready to be invoked.
           
          * FAILED – The agent alias API operation failed.
           
          * UPDATING – The agent alias is being updated.
           
          * DELETING – The agent alias is being deleted.
           
          * DISSOCIATED - The agent alias has no version associated with it.
          

          
        

        - **failureReasons** *(list) --* 

          Information on the failure of Provisioned Throughput assigned to an agent alias.

          
          

          - *(string) --* 
      
        

        - **aliasInvocationState** *(string) --* 

          The invocation state for the agent alias. If the agent alias is running, the value is ``ACCEPT_INVOCATIONS``. If the agent alias is paused, the value is ``REJECT_INVOCATIONS``. Use the ``UpdateAgentAlias`` operation to change the invocation state.

          
    
  
  **Exceptions**
  
  *   :py:class:`AgentsforBedrock.Client.exceptions.ThrottlingException`

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

  
  *   :py:class:`AgentsforBedrock.Client.exceptions.ValidationException`

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

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

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

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

  