---
title: DynamoDB TTL
slug: homologacao-atmosphere/dynamodb-ttl
description: Learn how to define the Time To Live (TTL) for a specific table in DynamoDB with this comprehensive document. Discover the necessary parameters, including state, table name, and attribute name, and explore examples for enabling and disabling the TTL. Find
createdAt: 2022-05-17T13:53:08.000Z
---

## Resumo

- Este módulo define o TTL para uma determinada tabela do DynamoDB.

## Parâmetros

| **Parâmetro**                | **Tipo** | **Escolhas \| Valor Padrão**           | **Comentários**                                                                                                                                             |
| ---------------------------- | -------- | -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| state                        | string   | Escolhas:<br />- enable<br />- disable | Estado para definir a tabela do DynamoDB.                                                                                                                   |
| table\_name - *required*     | string   |                                        | Nome da tabela do DynamoDB na qual trabalhar.                                                                                                               |
| attribute\_name - *required* | string   |                                        | O nome do atributo Time To Live usado para armazenar o tempo de expiração dos itens na tabela. Isso parece ser exigido pela API mesmo ao desabilitar o TTL. |



## Exemplos

```yaml
# Exemplo: Habilitar o TTL na minha tabela de dados
- dynamodb_ttl:
    state: enable
    table_name: tablefacts
    attribute_name: table_deleted_date
    region: us-east-1

# Exemplo: Desativar o TTL na minha tabela de dados
- dynamodb_ttl:
    state: disable
    table_name: tablefacts
    attribute_name: table_deleted_date
    region: us-east-1
```



## Valores retornados

| **Chave**       | **Tipo**   | **Retornado quando** | **Descrição**                    |
| --------------- | ---------- | -------------------- | -------------------------------- |
| current\_status | dictionary | Sempre               | Especificação TTL atual ou nova. |

