Skip to content

create_global_replication_group

create_global_replication_group(
    *,
    config_overrides: Optional[ElastiCacheClientConfig] = None,
    global_replication_group_id_suffix: Optional[String] = None,
    global_replication_group_description: Optional[String] = None,
    primary_replication_group_id: Optional[String] = None,
    tags: Optional[TagList] = None,
) -> CreateGlobalReplicationGroupResult

Global Datastore offers fully managed, fast, reliable and secure cross-region replication. Using Global Datastore with Valkey or Redis OSS, you can create cross-region read replica clusters for ElastiCache to enable low-latency reads and disaster recovery across regions. For more information, see Replication Across Regions Using Global Datastore.

  • The GlobalReplicationGroupIdSuffix is the name of the Global datastore.

  • The PrimaryReplicationGroupId represents the name of the primary cluster that accepts writes and will replicate updates to the secondary cluster.

Parameters:

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

    The suffix name of a Global datastore. Amazon ElastiCache automatically applies a prefix to the Global datastore ID when it is created. Each Amazon Region has its own prefix. For instance, a Global datastore ID created in the US-West-1 region will begin with "dsdfu" along with the suffix name you provide. The suffix, combined with the auto-generated prefix, guarantees uniqueness of the Global datastore name across multiple regions.

    For a full list of Amazon Regions and their respective Global datastore iD prefixes, see Using the Amazon CLI with Global datastores .

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

    Provides details of the Global datastore

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

    The name of the primary cluster that accepts writes and will replicate updates to the secondary cluster. This value is stored as a lowercase string.

  • 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:

Source code in docs_src/capo_elasticache/_services/elasti_cache.py
def create_global_replication_group(
    self,
    *,
    config_overrides: Optional[ElastiCacheClientConfig] = None,
    global_replication_group_id_suffix: Optional[
        "capo_elasticache.types.string.String"
    ] = None,
    global_replication_group_description: Optional[
        "capo_elasticache.types.string.String"
    ] = None,
    primary_replication_group_id: Optional[
        "capo_elasticache.types.string.String"
    ] = None,
    tags: Optional["capo_elasticache.types.tag_list.TagList"] = None,
) -> "capo_elasticache.types.create_global_replication_group_result.CreateGlobalReplicationGroupResult":
    """<p>Global Datastore offers fully managed, fast, reliable and secure cross-region replication. Using Global Datastore with Valkey or Redis OSS, you can create cross-region read replica clusters for ElastiCache to enable low-latency reads and disaster recovery across regions. For more information, see <a href="https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/Redis-Global-Datastore.html">Replication Across Regions Using Global Datastore</a>. </p> <ul> <li> <p>The <b>GlobalReplicationGroupIdSuffix</b> is the name of the Global datastore.</p> </li> <li> <p>The <b>PrimaryReplicationGroupId</b> represents the name of the primary cluster that accepts writes and will replicate updates to the secondary cluster.</p> </li> </ul>

    Args:
        global_replication_group_id_suffix: <p>The suffix name of a Global datastore. Amazon ElastiCache automatically applies a prefix to the Global datastore ID when it is created. Each Amazon Region has its own prefix. For instance, a Global datastore ID created in the US-West-1 region will begin with "dsdfu" along with the suffix name you provide. The suffix, combined with the auto-generated prefix, guarantees uniqueness of the Global datastore name across multiple regions. </p> <p>For a full list of Amazon Regions and their respective Global datastore iD prefixes, see <a href="http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/Redis-Global-Datastores-CLI.html">Using the Amazon CLI with Global datastores </a>.</p>
        global_replication_group_description: <p>Provides details of the Global datastore</p>
        primary_replication_group_id: <p>The name of the primary cluster that accepts writes and will replicate updates to the secondary cluster. This value is stored as a lowercase string.</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.global_replication_group_already_exists_fault.GlobalReplicationGroupAlreadyExistsFault: <p>The Global datastore name already exists.</p>
        capo_elasticache.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value for a parameter is invalid.</p>
        capo_elasticache.errors.invalid_replication_group_state_fault.InvalidReplicationGroupStateFault: <p>The requested replication group is not in the <code>available</code> state.</p>
        capo_elasticache.errors.replication_group_not_found_fault.ReplicationGroupNotFoundFault: <p>The specified replication group does not exist.</p>
        capo_elasticache.errors.service_linked_role_not_found_fault.ServiceLinkedRoleNotFoundFault: <p>The specified service linked role (SLR) was not found.</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.
    """

    def _handler(
        req: "OperationRequest[capo_elasticache.types.create_global_replication_group_message.CreateGlobalReplicationGroupMessage]",
    ) -> OperationResponse[
        "capo_elasticache.types.create_global_replication_group_result.CreateGlobalReplicationGroupResult"
    ]:
        import capo_elasticache._operations.amazon_elasti_cache_v9.create_global_replication_group

        output, http_response = (
            capo_elasticache._operations.amazon_elasti_cache_v9.create_global_replication_group.create_global_replication_group(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateGlobalReplicationGroup")
    )
    input_: capo_elasticache.types.create_global_replication_group_message.CreateGlobalReplicationGroupMessage = {}
    if global_replication_group_id_suffix is not None:
        input_["global_replication_group_id_suffix"] = (
            global_replication_group_id_suffix
        )
    if global_replication_group_description is not None:
        input_["global_replication_group_description"] = (
            global_replication_group_description
        )
    if primary_replication_group_id is not None:
        input_["primary_replication_group_id"] = primary_replication_group_id
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output