aws / aws/aws-cdk

(s3tables-alpha): support ReplicationConfiguration for TableBucket

Aperta
#37,653 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
@aws-cdk/aws-s3tables-alpha effort/medium feature-request p2
Lingua principale
TypeScript
Stelle
12.9k
Fork
4.6k
Merge medio
1g 19h
PR unite (30g)
71

Descrizione

### Describe the feature

Add support for S3 Tables Bucket replication by exposing the L1
`AWS::S3Tables::TableBucket` `ReplicationConfiguration` property through the
L2 `TableBucket` construct in `@aws-cdk/aws-s3tables-alpha`.

Related docs:
- https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-replication.html
- https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3tables-tablebucket-replicationconfiguration.html

### Use Case

We want to replicate S3 Tables across Regions / accounts for DR and
cross-account analytics. The L1 already accepts `ReplicationConfiguration`,
but the L2 `TableBucket` has no first-class API, so users have to drop down
to the `CfnTableBucket` escape hatch today.

### Proposed Solution

Add two flat props to `TableBucketProps` (mirroring the pattern used by
`aws-s3`'s `replicationRole` / `replicationRules`):

```ts
export interface TableBucketProps {
// ... existing props

/**
* Destination table buckets to replicate to.
*
* @default - No replication
*/
readonly replicationDestinations?: ITableBucket[];

/**
* The role to be used by the replication.
*
* When setting this property, you must also set `replicationDestinations`.
*
* @default - a new role will be created.
*/
readonly replicationRole?: iam.IRole;
}

// Usage
const dest = TableBucket.fromTableBucketArn(this, 'Dest', 'arn:...');
new TableBucket(this, 'Source', {
tableBucketName: 'src',
replicationDestinations: [dest],
});
```

When `replicationRole` is omitted the construct creates a role with
least-privilege replication permissions and an `s3tables.amazonaws.com` trust
policy with `aws:SourceAccount` / `aws:SourceArn` confused-deputy conditions.

Notes:
- The CFN `ReplicationConfiguration` wraps destinations in a `rules: []`
array, but a rule currently has no fields other than `destinations`, so
flattening to a single `replicationDestinations: ITableBucket[]` avoids a
speculative abstraction. If AWS later adds per-rule settings (filter,
priority, etc.), we can evolve the API — breaking changes are acceptable
in the alpha package.
- Escape hatch remains available via `node.defaultChild` on the underlying
`CfnTableBucket`.

### Other Information

- L1 types (`CfnTableBucket.ReplicationConfigurationProperty` etc.) already
exist in `aws-cdk-lib/aws-s3tables`, so no L1 work is needed.
- Additive props, no breaking change.

### Acknowledgements

- [x] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### AWS CDK Library version (aws-cdk-lib)

2.250.0

### AWS CDK CLI version

2.1030.0

### Environment details (OS name and version, etc.)

macOS 14.6 (Darwin 23.6.0)

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia leggendo gli entry point TableBucket e TableBucketProps in @aws-cdk/aws-s3tables-alpha, quindi confrontali con i tipi CfnTableBucket.ReplicationConfigurationProperty esistenti e con il pattern replicationRole/replicationRules di aws-s3. Verifica la documentazione sulla replica di AWS S3 Tables e definisci come completato il lavoro quando sono esposti i destination e role props, la sintesi L1 è corretta e sono presenti le autorizzazioni e le condizioni di trust richieste per il ruolo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
aws, typescript
Ambito
cloud, infrastructure
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
68/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.