ElastiCache / Client / authorize_cache_security_group_ingress

authorize_cache_security_group_ingress#

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

Request Syntax

response = client.authorize_cache_security_group_ingress(
    CacheSecurityGroupName='string',
    EC2SecurityGroupName='string',
    EC2SecurityGroupOwnerId='string'
)
Parameters:
  • CacheSecurityGroupName (string) –

    [REQUIRED]

    The cache security group that allows network ingress.

  • EC2SecurityGroupName (string) –

    [REQUIRED]

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

  • EC2SecurityGroupOwnerId (string) –

    [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.

Return type:

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

  • ElastiCache.Client.exceptions.CacheSecurityGroupNotFoundFault

  • ElastiCache.Client.exceptions.InvalidCacheSecurityGroupStateFault

  • ElastiCache.Client.exceptions.AuthorizationAlreadyExistsFault

  • ElastiCache.Client.exceptions.InvalidParameterValueException

  • 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': {
        '...': '...',
    },
}