:doc:`CognitoIdentityProvider <../../cognito-idp>` / Client / update_resource_server

**********************
update_resource_server
**********************



.. py:method:: CognitoIdentityProvider.Client.update_resource_server(**kwargs)

  

  Updates the name and scopes of a resource server. All other fields are read-only. For more information about resource servers, see `Access control with resource servers <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-define-resource-servers.html>`__.

   

  .. warning::

     

    If you don't provide a value for an attribute, it is set to the default value.

     

   

  .. note::

    

    Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

     

    **Learn more**

     

    
    * `Signing Amazon Web Services API Requests <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-signing.html>`__
     
    * `Using the Amazon Cognito user pools API and user pool endpoints <https://docs.aws.amazon.com/cognito/latest/developerguide/user-pools-API-operations.html>`__
    

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateResourceServer>`_  


  **Request Syntax**
  ::

    response = client.update_resource_server(
        UserPoolId='string',
        Identifier='string',
        Name='string',
        Scopes=[
            {
                'ScopeName': 'string',
                'ScopeDescription': 'string'
            },
        ]
    )
    
  :type UserPoolId: string
  :param UserPoolId: **[REQUIRED]** 

    The ID of the user pool that contains the resource server that you want to update.

    

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

    A unique resource server identifier for the resource server. The identifier can be an API friendly name like ``solar-system-data``. You can also set an API URL like ``https://solar-system-data-api.example.com`` as your identifier.

     

    Amazon Cognito represents scopes in the access token in the format ``$resource-server-identifier/$scope``. Longer scope-identifier strings increase the size of your access tokens.

    

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

    The updated name of the resource server.

    

  
  :type Scopes: list
  :param Scopes: 

    An array of updated custom scope names and descriptions that you want to associate with your resource server.

    

  
    - *(dict) --* 

      One custom scope associated with a user pool resource server. This data type is a member of ``ResourceServerScopeType``. For more information, see `Scopes, M2M, and API authorization with resource servers <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-define-resource-servers.html>`__.

      

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

        The name of the scope. Amazon Cognito renders custom scopes in the format ``resourceServerIdentifier/ScopeName``. For example, if this parameter is ``exampleScope`` in the resource server with the identifier ``exampleResourceServer``, you request and receive the scope ``exampleResourceServer/exampleScope``.

        

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

        A friendly description of a custom scope.

        

      
    

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

    
    ::

      {
          'ResourceServer': {
              'UserPoolId': 'string',
              'Identifier': 'string',
              'Name': 'string',
              'Scopes': [
                  {
                      'ScopeName': 'string',
                      'ScopeDescription': 'string'
                  },
              ]
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ResourceServer** *(dict) --* 

        The updated details of the requested resource server.

        
        

        - **UserPoolId** *(string) --* 

          The ID of the user pool that contains the resource server configuration.

          
        

        - **Identifier** *(string) --* 

          A unique resource server identifier for the resource server. The identifier can be an API friendly name like ``solar-system-data``. You can also set an API URL like ``https://solar-system-data-api.example.com`` as your identifier.

           

          Amazon Cognito represents scopes in the access token in the format ``$resource-server-identifier/$scope``. Longer scope-identifier strings increase the size of your access tokens.

          
        

        - **Name** *(string) --* 

          The name of the resource server.

          
        

        - **Scopes** *(list) --* 

          A list of scopes that are defined for the resource server.

          
          

          - *(dict) --* 

            One custom scope associated with a user pool resource server. This data type is a member of ``ResourceServerScopeType``. For more information, see `Scopes, M2M, and API authorization with resource servers <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-define-resource-servers.html>`__.

            
            

            - **ScopeName** *(string) --* 

              The name of the scope. Amazon Cognito renders custom scopes in the format ``resourceServerIdentifier/ScopeName``. For example, if this parameter is ``exampleScope`` in the resource server with the identifier ``exampleResourceServer``, you request and receive the scope ``exampleResourceServer/exampleScope``.

              
            

            - **ScopeDescription** *(string) --* 

              A friendly description of a custom scope.

              
        
      
    
  
  **Exceptions**
  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.InvalidParameterException`

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

  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.NotAuthorizedException`

  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.TooManyRequestsException`

  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.InternalErrorException`

  