# ConsumerGroupReplicationProperty

Details about consumer group replication.

- Source: Generated at build time
- Type last changed: v2.251.0 · 24 Apr 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_msk as msk } from 'aws-cdk-lib';
const consumerGroupReplicationProperty: msk.CfnReplicator.ConsumerGroupReplicationProperty = {
  consumerGroupsToReplicate: ['consumerGroupsToReplicate'],

  // the properties below are optional
  consumerGroupOffsetSyncMode: 'consumerGroupOffsetSyncMode',
  consumerGroupsToExclude: ['consumerGroupsToExclude'],
  detectAndCopyNewConsumerGroups: false,
  synchroniseConsumerGroupOffsets: false,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_msk as msk

consumer_group_replication_property = msk.CfnReplicator.ConsumerGroupReplicationProperty(
    consumer_groups_to_replicate=["consumerGroupsToReplicate"],

    # the properties below are optional
    consumer_group_offset_sync_mode="consumerGroupOffsetSyncMode",
    consumer_groups_to_exclude=["consumerGroupsToExclude"],
    detect_and_copy_new_consumer_groups=False,
    synchronise_consumer_group_offsets=False
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.msk.*;

ConsumerGroupReplicationProperty consumerGroupReplicationProperty = ConsumerGroupReplicationProperty.builder()
        .consumerGroupsToReplicate(List.of("consumerGroupsToReplicate"))

        // the properties below are optional
        .consumerGroupOffsetSyncMode("consumerGroupOffsetSyncMode")
        .consumerGroupsToExclude(List.of("consumerGroupsToExclude"))
        .detectAndCopyNewConsumerGroups(false)
        .synchroniseConsumerGroupOffsets(false)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.MSK;

var consumerGroupReplicationProperty = new ConsumerGroupReplicationProperty {
    ConsumerGroupsToReplicate = new [] { "consumerGroupsToReplicate" },

    // the properties below are optional
    ConsumerGroupOffsetSyncMode = "consumerGroupOffsetSyncMode",
    ConsumerGroupsToExclude = new [] { "consumerGroupsToExclude" },
    DetectAndCopyNewConsumerGroups = false,
    SynchroniseConsumerGroupOffsets = false
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

consumerGroupReplicationProperty := &ConsumerGroupReplicationProperty{
	ConsumerGroupsToReplicate: []*string{
		jsii.String("consumerGroupsToReplicate"),
	},

	// the properties below are optional
	ConsumerGroupOffsetSyncMode: jsii.String("consumerGroupOffsetSyncMode"),
	ConsumerGroupsToExclude: []*string{
		jsii.String("consumerGroupsToExclude"),
	},
	DetectAndCopyNewConsumerGroups: jsii.Boolean(false),
	SynchroniseConsumerGroupOffsets: jsii.Boolean(false),
}
```

## Properties

- `consumerGroupOffsetSyncMode`: string — The consumer group offset synchronization mode.

- `consumerGroupsToExclude`: string[] — List of regular expression patterns indicating the consumer groups that should not be replicated.

- `consumerGroupsToReplicate`: string[] (required) — List of regular expression patterns indicating the consumer groups to copy.

- `detectAndCopyNewConsumerGroups`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Enables synchronization of consumer groups to target cluster.

- `synchroniseConsumerGroupOffsets`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Enables synchronization of consumer group offsets to target cluster.

  The translated offsets will be written to topic __consumer_offsets.
