Skip to content

aws_dynamodb: allow point_in_time_recovery to be IResolvable #19748

@rittneje

Description

@rittneje

Describe the feature

The point_in_time_recovery field passed to the aws_dynamodb.Table constructor should also permit an IResolvable to be passed.

The underlying CfnTable resource already allows an IResolvable for point_in_time_recovery_enabled. https://docs.aws.amazon.com/cdk/api/v1/python/aws_cdk.aws_dynamodb/CfnTable.html#aws_cdk.aws_dynamodb.CfnTable.PointInTimeRecoverySpecificationProperty

Use Case

We want to use an Aspect to check that developers either enable point-in-time recovery for our production account, or explicitly disable it for all accounts. Currently, this is not feasible for two reasons:

  1. We cannot distinguish explicit disable from implicit disable.
  2. We cannot just hard-code True because it is contingent upon the account.

Instead, we want to make two implementations of IResolvable. Then the Aspect can simply check that point_in_time_recovery_enabled is set to an instance of once of these two classes.

Proposed Solution

Fix the Table constructor to allow for IResolvable for point_in_time_recovery. If provided, it will generate the corresponding PointInTimeRecoverySpecificationProperty instance.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

1.140.0

Environment details (OS name and version, etc.)

Alpine 3.15

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-dynamodbRelated to Amazon DynamoDBfeature-requestA feature should be added or improved.needs-triageThis issue or PR still needs to be triaged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions