:doc:`AppRegistry <../../servicecatalog-appregistry>` / Client / associate_resource

******************
associate_resource
******************



.. py:method:: AppRegistry.Client.associate_resource(**kwargs)

  

  Associates a resource with an application. The resource can be specified by its ARN or name. The application can be specified by ARN, ID, or name.

   

  **Minimum permissions**

   

  You must have the following permissions to associate a resource using the ``OPTIONS`` parameter set to ``APPLY_APPLICATION_TAG``.

   

  
  * ``tag:GetResources``
   
  * ``tag:TagResources``
  

   

  You must also have these additional permissions if you don't use the ``AWSServiceCatalogAppRegistryFullAccess`` policy. For more information, see `AWSServiceCatalogAppRegistryFullAccess <https://docs.aws.amazon.com/servicecatalog/latest/arguide/full.html>`__ in the AppRegistry Administrator Guide.

   

  
  * ``resource-groups:AssociateResource``
   
  * ``cloudformation:UpdateStack``
   
  * ``cloudformation:DescribeStacks``
  

   

  .. note::

    

    In addition, you must have the tagging permission defined by the Amazon Web Services service that creates the resource. For more information, see `TagResources <https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_TagResources.html>`__ in the *Resource Groups Tagging API Reference*.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/AWS242AppRegistry-2020-06-24/AssociateResource>`_  


  **Request Syntax**
  ::

    response = client.associate_resource(
        application='string',
        resourceType='CFN_STACK'|'RESOURCE_TAG_VALUE',
        resource='string',
        options=[
            'APPLY_APPLICATION_TAG'|'SKIP_APPLICATION_TAG',
        ]
    )
    
  :type application: string
  :param application: **[REQUIRED]** 

    The name, ID, or ARN of the application.

    

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

    The type of resource of which the application will be associated.

    

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

    The name or ID of the resource of which the application will be associated.

    

  
  :type options: list
  :param options: 

    Determines whether an application tag is applied or skipped.

    

  
    - *(string) --* 

    

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

    
    ::

      {
          'applicationArn': 'string',
          'resourceArn': 'string',
          'options': [
              'APPLY_APPLICATION_TAG'|'SKIP_APPLICATION_TAG',
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **applicationArn** *(string) --* 

        The Amazon resource name (ARN) of the application that was augmented with attributes.

        
      

      - **resourceArn** *(string) --* 

        The Amazon resource name (ARN) that specifies the resource.

        
      

      - **options** *(list) --* 

        Determines whether an application tag is applied or skipped.

        
        

        - *(string) --* 
    
  
  **Exceptions**
  
  *   :py:class:`AppRegistry.Client.exceptions.ResourceNotFoundException`

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

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

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

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

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

  