Skip to content

Commit 34f322e

Browse files
committed
docs: cleanup persistence layers attrs, snippet titles etc
Signed-off-by: heitorlessa <[email protected]>
1 parent 6029a2c commit 34f322e

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

docs/utilities/idempotency.md

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -333,15 +333,13 @@ If an exception is handled or raised **outside** your decorated function, then i
333333

334334
This persistence layer is built-in, allowing you to use an existing DynamoDB table or create a new one dedicated to idempotency state (recommended).
335335

336-
=== "Customizing DynamoDBPersistenceLayer to suit your table structure"
337-
338-
```python hl_lines="7-15"
339-
--8<-- "examples/idempotency/src/customize_persistence_layer.py"
340-
```
336+
```python title="customize_persistence_layer.py" hl_lines="7-15"
337+
--8<-- "examples/idempotency/src/customize_persistence_layer.py"
338+
```
341339

342-
##### DynamoDB defaults
340+
##### DynamoDB attributes
343341

344-
When using DynamoDB as the persistence layer, you can customize the attribute names by passing the following parameters during the initialization of the persistence layer:
342+
You can customize the attribute names during initialization:
345343

346344
| Parameter | Required | Default | Description |
347345
| --------------------------- | ------------------ | ------------------------------------ | -------------------------------------------------------------------------------------------------------- |
@@ -359,34 +357,34 @@ When using DynamoDB as the persistence layer, you can customize the attribute na
359357

360358
!!! info "We recommend Redis version 7 or higher for optimal performance."
361359

362-
For a quick start, initialize `RedisCachePersistenceLayer` and pass your cluster host endpoint along with the port to connect to.
360+
For simple setups, initialize `RedisCachePersistenceLayer` with your cluster endpoint and port to connect.
363361

364362
For security, we enforce SSL connections by default; to disable it, set `ssl=False`.
365363

366364
=== "Redis quick start"
367-
```python hl_lines="7-9 12 26"
365+
```python title="getting_started_with_idempotency_redis_config.py" hl_lines="7-9 12 26"
368366
--8<-- "examples/idempotency/src/getting_started_with_idempotency_redis_config.py"
369367
```
370368

371369
=== "Using an existing Redis client"
372-
```python hl_lines="4 9-11 14 22 36"
370+
```python title="getting_started_with_idempotency_redis_client.py" hl_lines="4 9-11 14 22 36"
373371
--8<-- "examples/idempotency/src/getting_started_with_idempotency_redis_client.py"
374372
```
375373

376374
=== "Sample event"
377375

378-
```json
376+
```json title="getting_started_with_idempotency_payload.json"
379377
--8<-- "examples/idempotency/src/getting_started_with_idempotency_payload.json"
380378
```
381379

382380
##### Redis SSL connections
383381

384382
We recommend using AWS Secrets Manager to store and rotate certificates safely, and the [Parameters feature](./parameters.md){target="_blank"} to fetch and cache optimally.
385383

386-
For advanced configurations, we also recommend using an existing Redis client for optimal compatibility like SSL certificates and timeout.
384+
For advanced configurations, we recommend using an existing Redis client for optimal compatibility like SSL certificates and timeout.
387385

388386
=== "Advanced configuration using AWS Secrets"
389-
```python hl_lines="9-11 13 15 25"
387+
```python title="using_redis_client_with_aws_secrets.py" hl_lines="9-11 13 15 25"
390388
--8<-- "examples/idempotency/src/using_redis_client_with_aws_secrets.py"
391389
```
392390

@@ -400,7 +398,7 @@ For advanced configurations, we also recommend using an existing Redis client fo
400398
```
401399

402400
=== "Advanced configuration with local certificates"
403-
```python hl_lines="14 25-27"
401+
```python title="using_redis_client_with_local_certs.py" hl_lines="14 25-27"
404402
--8<-- "examples/idempotency/src/using_redis_client_with_local_certs.py"
405403
```
406404

@@ -416,9 +414,9 @@ For advanced configurations, we also recommend using an existing Redis client fo
416414
3. redis_user_private.key file stored in the "certs" directory of your Lambda function
417415
4. redis_ca.pem file stored in the "certs" directory of your Lambda function
418416

419-
##### Redis defaults
417+
##### Redis attributes
420418

421-
You can customize attribute names when instantiating `RedisCachePersistenceLayer` with the following parameters:
419+
You can customize the attribute names during initialization:
422420

423421
| Parameter | Required | Default | Description |
424422
| --------------------------- | -------- | ------------------------ | --------------------------------------------------------------------------------------------- |
@@ -427,11 +425,9 @@ You can customize attribute names when instantiating `RedisCachePersistenceLayer
427425
| **data_attr** | | `data` | Stores results of successfully executed Lambda handlers |
428426
| **validation_key_attr** | | `validation` | Hashed representation of the parts of the event used for validation |
429427

430-
=== "Customizing RedisPersistenceLayer to suit your data structure"
431-
432-
```python hl_lines="9-16"
433-
--8<-- "examples/idempotency/src/customize_persistence_layer_redis.py"
434-
```
428+
```python title="customize_persistence_layer_redis.py" hl_lines="9-16"
429+
--8<-- "examples/idempotency/src/customize_persistence_layer_redis.py"
430+
```
435431

436432
### Common use cases
437433

0 commit comments

Comments
 (0)