Skip to content

revoke_cache_security_group_ingress async

revoke_cache_security_group_ingress(
    *,
    config_overrides: Optional[AsyncElastiCacheClientConfig] = None,
    cache_security_group_name: Optional[String] = None,
    ec2_security_group_name: Optional[String] = None,
    ec2_security_group_owner_id: Optional[String] = None,
) -> RevokeCacheSecurityGroupIngressResult

Revokes ingress from a cache security group. Use this operation to disallow access from an Amazon EC2 security group that had been previously authorized.

Parameters:

  • cache_security_group_name (Optional[String], default: None ) –

    The name of the cache security group to revoke ingress from.

  • ec2_security_group_name (Optional[String], default: None ) –

    The name of the Amazon EC2 security group to revoke access from.

  • ec2_security_group_owner_id (Optional[String], default: None ) –

    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.

Raises:

Examples:

DescribeCacheSecurityGroups Returns a list of cache security group descriptions. If a cache security group name is specified, the list contains only the description of that group.

>>> await client.revoke_cache_security_group_ingress(cache_security_group_name='my-sec-grp', ec2_security_group_name='my-ec2-sec-grp', ec2_security_group_owner_id='1234567890')
Source code in docs_src/capo_elasticache/_services/async_elasti_cache.py
async def revoke_cache_security_group_ingress(
    self,
    *,
    config_overrides: Optional[AsyncElastiCacheClientConfig] = None,
    cache_security_group_name: Optional[
        "capo_elasticache.types.string.String"
    ] = None,
    ec2_security_group_name: Optional[
        "capo_elasticache.types.string.String"
    ] = None,
    ec2_security_group_owner_id: Optional[
        "capo_elasticache.types.string.String"
    ] = None,
) -> "capo_elasticache.types.revoke_cache_security_group_ingress_result.RevokeCacheSecurityGroupIngressResult":
    """<p>Revokes ingress from a cache security group. Use this operation to disallow access from an Amazon EC2 security group that had been previously authorized.</p>

    Args:
        cache_security_group_name: <p>The name of the cache security group to revoke ingress from.</p>
        ec2_security_group_name: <p>The name of the Amazon EC2 security group to revoke access from.</p>
        ec2_security_group_owner_id: <p>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.</p>

    Raises:
        capo_elasticache.errors.authorization_not_found_fault.AuthorizationNotFoundFault: <p>The specified Amazon EC2 security group is not authorized for the specified cache security group.</p>
        capo_elasticache.errors.cache_security_group_not_found_fault.CacheSecurityGroupNotFoundFault: <p>The requested cache security group name does not refer to an existing cache security group.</p>
        capo_elasticache.errors.invalid_cache_security_group_state_fault.InvalidCacheSecurityGroupStateFault: <p>The current state of the cache security group does not allow deletion.</p>
        capo_elasticache.errors.invalid_parameter_combination_exception.InvalidParameterCombinationException: <p>Two or more incompatible parameters were specified.</p>
        capo_elasticache.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value for a parameter is invalid.</p>
        capo_elasticache.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        DescribeCacheSecurityGroups
        Returns a list of cache security group descriptions. If a cache security group name is specified, the list contains only the description of that group.

        >>> await client.revoke_cache_security_group_ingress(cache_security_group_name='my-sec-grp', ec2_security_group_name='my-ec2-sec-grp', ec2_security_group_owner_id='1234567890')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_elasticache.types.revoke_cache_security_group_ingress_message.RevokeCacheSecurityGroupIngressMessage]",
    ) -> AsyncOperationResponse[
        "capo_elasticache.types.revoke_cache_security_group_ingress_result.RevokeCacheSecurityGroupIngressResult"
    ]:
        import capo_elasticache._operations.amazon_elasti_cache_v9.revoke_cache_security_group_ingress

        (
            output,
            http_response,
        ) = await capo_elasticache._operations.amazon_elasti_cache_v9.revoke_cache_security_group_ingress.async_revoke_cache_security_group_ingress(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RevokeCacheSecurityGroupIngress")
    )
    input_: capo_elasticache.types.revoke_cache_security_group_ingress_message.RevokeCacheSecurityGroupIngressMessage = {}
    if cache_security_group_name is not None:
        input_["cache_security_group_name"] = cache_security_group_name
    if ec2_security_group_name is not None:
        input_["ec2_security_group_name"] = ec2_security_group_name
    if ec2_security_group_owner_id is not None:
        input_["ec2_security_group_owner_id"] = ec2_security_group_owner_id

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output