:doc:`ElastiCache <../../elasticache>` / Client / authorize_cache_security_group_ingress

**************************************
authorize_cache_security_group_ingress
**************************************



.. py:method:: ElastiCache.Client.authorize_cache_security_group_ingress(**kwargs)

  

  Allows network ingress to a cache security group. Applications using ElastiCache must be running on Amazon EC2, and Amazon EC2 security groups are used as the authorization mechanism.

   

  .. note::

    

    You cannot authorize ingress from an Amazon EC2 security group in one region to an ElastiCache cluster in another region.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/AuthorizeCacheSecurityGroupIngress>`_  


  **Request Syntax**
  ::

    response = client.authorize_cache_security_group_ingress(
        CacheSecurityGroupName='string',
        EC2SecurityGroupName='string',
        EC2SecurityGroupOwnerId='string'
    )
    
  :type CacheSecurityGroupName: string
  :param CacheSecurityGroupName: **[REQUIRED]** 

    The cache security group that allows network ingress.

    

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

    The Amazon EC2 security group to be authorized for ingress to the cache security group.

    

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

    The Amazon account number of the Amazon EC2 security group owner. Note that this is not the same thing as an Amazon access key ID - you must provide a valid Amazon account number for this parameter.

    

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

    
    ::

      {
          'CacheSecurityGroup': {
              'OwnerId': 'string',
              'CacheSecurityGroupName': 'string',
              'Description': 'string',
              'EC2SecurityGroups': [
                  {
                      'Status': 'string',
                      'EC2SecurityGroupName': 'string',
                      'EC2SecurityGroupOwnerId': 'string'
                  },
              ],
              'ARN': 'string'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **CacheSecurityGroup** *(dict) --* 

        Represents the output of one of the following operations:

         

        
        * ``AuthorizeCacheSecurityGroupIngress``
         
        * ``CreateCacheSecurityGroup``
         
        * ``RevokeCacheSecurityGroupIngress``
        

        
        

        - **OwnerId** *(string) --* 

          The Amazon account ID of the cache security group owner.

          
        

        - **CacheSecurityGroupName** *(string) --* 

          The name of the cache security group.

          
        

        - **Description** *(string) --* 

          The description of the cache security group.

          
        

        - **EC2SecurityGroups** *(list) --* 

          A list of Amazon EC2 security groups that are associated with this cache security group.

          
          

          - *(dict) --* 

            Provides ownership and status information for an Amazon EC2 security group.

            
            

            - **Status** *(string) --* 

              The status of the Amazon EC2 security group.

              
            

            - **EC2SecurityGroupName** *(string) --* 

              The name of the Amazon EC2 security group.

              
            

            - **EC2SecurityGroupOwnerId** *(string) --* 

              The Amazon account ID of the Amazon EC2 security group owner.

              
        
      
        

        - **ARN** *(string) --* 

          The ARN of the cache security group,

          
    
  
  **Exceptions**
  
  *   :py:class:`ElastiCache.Client.exceptions.CacheSecurityGroupNotFoundFault`

  
  *   :py:class:`ElastiCache.Client.exceptions.InvalidCacheSecurityGroupStateFault`

  
  *   :py:class:`ElastiCache.Client.exceptions.AuthorizationAlreadyExistsFault`

  
  *   :py:class:`ElastiCache.Client.exceptions.InvalidParameterValueException`

  
  *   :py:class:`ElastiCache.Client.exceptions.InvalidParameterCombinationException`

  

  **Examples**

  Allows network ingress to a cache security group. Applications using ElastiCache must be running on Amazon EC2. Amazon EC2 security groups are used as the authorization mechanism.
  ::

    response = client.authorize_cache_security_group_ingress(
        CacheSecurityGroupName='my-sec-grp',
        EC2SecurityGroupName='my-ec2-sec-grp',
        EC2SecurityGroupOwnerId='1234567890',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'ResponseMetadata': {
            '...': '...',
        },
    }

  