Skip to content

create_cache_parameter_group async

create_cache_parameter_group(
    *,
    config_overrides: Optional[AsyncElastiCacheClientConfig] = None,
    cache_parameter_group_name: Optional[String] = None,
    cache_parameter_group_family: Optional[String] = None,
    description: Optional[String] = None,
    tags: Optional[TagList] = None,
) -> CreateCacheParameterGroupResult

Creates a new Amazon ElastiCache cache parameter group. An ElastiCache cache parameter group is a collection of parameters and their values that are applied to all of the nodes in any cluster or replication group using the CacheParameterGroup.

A newly created CacheParameterGroup is an exact duplicate of the default parameter group for the CacheParameterGroupFamily. To customize the newly created CacheParameterGroup you can change the values of specific parameters. For more information, see:

Parameters:

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

    A user-specified name for the cache parameter group. This value is stored as a lowercase string.

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

    The name of the cache parameter group family that the cache parameter group can be used with.

    Valid values are: valkey8 | valkey7 | memcached1.4 | memcached1.5 | memcached1.6 | redis2.6 | redis2.8 | redis3.2 | redis4.0 | redis5.0 | redis6.x | redis7

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

    A user-specified description for the cache parameter group.

  • tags (Optional[TagList], default: None ) –

    A list of tags to be added to this resource. A tag is a key-value pair. A tag key must be accompanied by a tag value, although null is accepted.

Raises:

Examples:

CreateCacheParameterGroup Creates the Amazon ElastiCache parameter group custom-redis2-8.

>>> await client.create_cache_parameter_group(cache_parameter_group_name='custom-redis2-8', cache_parameter_group_family='redis2.8', description='Custom Redis 2.8 parameter group.')
Source code in docs_src/capo_elasticache/_services/async_elasti_cache.py
async def create_cache_parameter_group(
    self,
    *,
    config_overrides: Optional[AsyncElastiCacheClientConfig] = None,
    cache_parameter_group_name: Optional[
        "capo_elasticache.types.string.String"
    ] = None,
    cache_parameter_group_family: Optional[
        "capo_elasticache.types.string.String"
    ] = None,
    description: Optional["capo_elasticache.types.string.String"] = None,
    tags: Optional["capo_elasticache.types.tag_list.TagList"] = None,
) -> "capo_elasticache.types.create_cache_parameter_group_result.CreateCacheParameterGroupResult":
    """<p>Creates a new Amazon ElastiCache cache parameter group. An ElastiCache cache parameter group is a collection of parameters and their values that are applied to all of the nodes in any cluster or replication group using the CacheParameterGroup.</p> <p>A newly created CacheParameterGroup is an exact duplicate of the default parameter group for the CacheParameterGroupFamily. To customize the newly created CacheParameterGroup you can change the values of specific parameters. For more information, see:</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_ModifyCacheParameterGroup.html">ModifyCacheParameterGroup</a> in the ElastiCache API Reference.</p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/ParameterGroups.html">Parameters and Parameter Groups</a> in the ElastiCache User Guide.</p> </li> </ul>

    Args:
        cache_parameter_group_name: <p>A user-specified name for the cache parameter group. This value is stored as a lowercase string.</p>
        cache_parameter_group_family: <p>The name of the cache parameter group family that the cache parameter group can be used with.</p> <p>Valid values are: <code>valkey8</code> | <code>valkey7</code> | <code>memcached1.4</code> | <code>memcached1.5</code> | <code>memcached1.6</code> | <code>redis2.6</code> | <code>redis2.8</code> | <code>redis3.2</code> | <code>redis4.0</code> | <code>redis5.0</code> | <code>redis6.x</code> | <code>redis7</code> </p>
        description: <p>A user-specified description for the cache parameter group.</p>
        tags: <p>A list of tags to be added to this resource. A tag is a key-value pair. A tag key must be accompanied by a tag value, although null is accepted.</p>

    Raises:
        capo_elasticache.errors.cache_parameter_group_already_exists_fault.CacheParameterGroupAlreadyExistsFault: <p>A cache parameter group with the requested name already exists.</p>
        capo_elasticache.errors.cache_parameter_group_quota_exceeded_fault.CacheParameterGroupQuotaExceededFault: <p>The request cannot be processed because it would exceed the maximum number of cache security groups.</p>
        capo_elasticache.errors.invalid_cache_parameter_group_state_fault.InvalidCacheParameterGroupStateFault: <p>The current state of the cache parameter group does not allow the requested operation to occur.</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.tag_quota_per_resource_exceeded.TagQuotaPerResourceExceeded: <p>The request cannot be processed because it would cause the resource to have more than the allowed number of tags. The maximum number of tags permitted on a resource is 50.</p>
        capo_elasticache.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        CreateCacheParameterGroup
        Creates the Amazon ElastiCache parameter group custom-redis2-8.

        >>> await client.create_cache_parameter_group(cache_parameter_group_name='custom-redis2-8', cache_parameter_group_family='redis2.8', description='Custom Redis 2.8 parameter group.')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_elasticache.types.create_cache_parameter_group_message.CreateCacheParameterGroupMessage]",
    ) -> AsyncOperationResponse[
        "capo_elasticache.types.create_cache_parameter_group_result.CreateCacheParameterGroupResult"
    ]:
        import capo_elasticache._operations.amazon_elasti_cache_v9.create_cache_parameter_group

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateCacheParameterGroup")
    )
    input_: capo_elasticache.types.create_cache_parameter_group_message.CreateCacheParameterGroupMessage = {}
    if cache_parameter_group_name is not None:
        input_["cache_parameter_group_name"] = cache_parameter_group_name
    if cache_parameter_group_family is not None:
        input_["cache_parameter_group_family"] = cache_parameter_group_family
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags

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