Minimal implementation for continuous backup#7735
Conversation
Implemented only the required responsed for the update and
describe continuous backup in DDB, as requested to increase the
parity with Terraform.
557662f to
def5207
Compare
| def describe_continuous_backups( | ||
| self, context: RequestContext, table_name: TableName | ||
| ) -> DescribeContinuousBackupsOutput: | ||
| self.get_global_table_region(context, table_name) |
There was a problem hiding this comment.
Should we take the result of this call and use it as the region for the store? (same pattern we're also using for other methods in the provider..)
global_table_region = self.get_global_table_region(context, table_name)
store = get_store(context.account_id, region=global_table_region)
There was a problem hiding this comment.
I am actually not sure about the behavior here.
If I remember correctly our implementation of global tables, we actually keep in DynamoDB local a single table in a given region. When we receive a request from a global region, we check with get_global_table_region which is the region that actually holds the data in DDBLocal, and forwards the calls to that specific region with self._forward_request(context=context, region=global_table_region) (we basically modify the region in the context to hit the "original" region). All over the provider, we use this global_table_region only to patch the forwarded request, but we access the store with the actual region in the context.
| table_name: TableName, | ||
| point_in_time_recovery_specification: PointInTimeRecoverySpecification, | ||
| ) -> UpdateContinuousBackupsOutput: | ||
| self.get_global_table_region(context, table_name) |
There was a problem hiding this comment.
same as above, regarding assigning and using global_table_region..
| ), | ||
| ) | ||
| return True | ||
| except ContinuousBackupsUnavailableException: |
There was a problem hiding this comment.
Out of curiosity - under which circumstances would we run into this error here? Is this happening during creation of the DDB table, until the table status becomes ACTIVE? Wondering if we should add a flag to the dynamodb_create_table fixture to wait until the table becomes active. Also, we have a dynamodb_wait_for_table_active fixture, which may come in handy here?
There was a problem hiding this comment.
By default, all the tables in DDB have continuous backup enabled. However, I found that AWS takes a few seconds to enable such backups after a table has been created and is active. This basically was needed to generate the snapshot.
This PR enables a minimal implementation for the
UpdateContinuousBackupsandDescribeContinuousBackupsactions.The feature of continuous backup is actually not implemented. We only return the minimum needed to achieve Terraform parity for #7569.