1 個回答
- 最新
- 最多得票
- 最多評論
1
Hi Boombala,
Please try this below solution i hope it will be helpful for you.
Check AWS Console and CLI:
- First, check the AWS Management Console to see if the table is still in the "Deleting" status.
- Use the AWS CLI to check the status of the table as well:
aws dynamodb describe-table --table-name <YourTableName>
- This will give you the current status of the table.
Wait for the Deletion to Complete:
- Sometimes, the deletion process can take some time. Wait for a few minutes and check the status again.
Retry Disabling Deletion Protection:
- If the table is still in the "Deleting" status, try disabling the deletion protection again using the AWS CLI:
aws dynamodb update-table --table-name <YourTableName> --deletion-protection-enabled false
- Then, attempt to delete the table again:
aws dynamodb delete-table --table-name <YourTableName>
Contact AWS Support:
- If the table remains in the "Deleting" status for an extended period, it might require intervention from AWS Support. Open a support ticket with AWS, explaining the situation. Provide them with the table name and any relevant details.
Automate with Terraform:
- Ensure your Terraform script handles the disabling of deletion protection before attempting to delete the table. You can add a step in your Terraform script to update the deletion protection attribute before the delete action.
Here's a brief Terraform example to update the deletion protection before deletion:
resource "aws_dynamodb_table" "example" {
name = "example-table"
hash_key = "example-key"
billing_mode = "PAY_PER_REQUEST"
attribute {
name = "example-key"
type = "S"
}
deletion_protection_enabled = false
lifecycle {
ignore_changes = [deletion_protection_enabled]
}
}
Then, you can apply the changes:
terraform apply
Finally, delete the table:
terraform destroy
相關內容
- 已提問 1 年前
- AWS 官方已更新 4 個月前
- AWS 官方已更新 1 年前
- AWS 官方已更新 2 年前