# PointInTimeRecoverySpecification

Reference to PointInTimeRecovey Specification for continuous backups.

- Source: [`aws-dynamodb/lib/shared.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-dynamodb/lib/shared.ts#L112)
- Type last changed: v2.178.0 · 6 Feb 2025

## Example

TypeScript:

```ts
const table = new dynamodb.TableV2(this, 'Table', {
  partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
  contributorInsightsSpecification: {
    enabled: true,
  },
  tableClass: dynamodb.TableClass.STANDARD_INFREQUENT_ACCESS,
  pointInTimeRecoverySpecification: {
    pointInTimeRecoveryEnabled: true,
  },
});
```

Python:

```python
table = dynamodb.TableV2(self, "Table",
    partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
    contributor_insights_specification=dynamodb.ContributorInsightsSpecification(
        enabled=True
    ),
    table_class=dynamodb.TableClass.STANDARD_INFREQUENT_ACCESS,
    point_in_time_recovery_specification=dynamodb.PointInTimeRecoverySpecification(
        point_in_time_recovery_enabled=True
    )
)
```

Java:

```java
TableV2 table = TableV2.Builder.create(this, "Table")
        .partitionKey(Attribute.builder().name("pk").type(AttributeType.STRING).build())
        .contributorInsightsSpecification(ContributorInsightsSpecification.builder()
                .enabled(true)
                .build())
        .tableClass(TableClass.STANDARD_INFREQUENT_ACCESS)
        .pointInTimeRecoverySpecification(PointInTimeRecoverySpecification.builder()
                .pointInTimeRecoveryEnabled(true)
                .build())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
var table = new TableV2(this, "Table", new TablePropsV2 {
    PartitionKey = new Attribute { Name = "pk", Type = AttributeType.STRING },
    ContributorInsightsSpecification = new ContributorInsightsSpecification {
        Enabled = true
    },
    TableClass = TableClass.STANDARD_INFREQUENT_ACCESS,
    PointInTimeRecoverySpecification = new PointInTimeRecoverySpecification {
        PointInTimeRecoveryEnabled = true
    }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	ContributorInsightsSpecification: &ContributorInsightsSpecification{
		Enabled: jsii.Boolean(true),
	},
	TableClass: dynamodb.TableClass_STANDARD_INFREQUENT_ACCESS,
	PointInTimeRecoverySpecification: &PointInTimeRecoverySpecification{
		PointInTimeRecoveryEnabled: jsii.Boolean(true),
	},
})
```

## Properties

- `pointInTimeRecoveryEnabled`: boolean (required) = false — Indicates whether point in time recovery is enabled (true) or disabled (false) on the table.

- `recoveryPeriodInDays`: number = 35 — The number of preceding days for which continuous backups are taken and maintained.

  Your table data is only recoverable to any point-in-time from within the configured recovery period.
  If no value is provided, the value will default to 35.
