Skip to content

chore: Updated cloud-nuke config to remove dynamodb tables - #4531

Merged
denis256 merged 1 commit into
mainfrom
cloud-nuke-dynamodb
Jul 11, 2025
Merged

chore: Updated cloud-nuke config to remove dynamodb tables#4531
denis256 merged 1 commit into
mainfrom
cloud-nuke-dynamodb

Conversation

@denis256

@denis256 denis256 commented Jul 11, 2025

Copy link
Copy Markdown
Member

Description

  • Updated cloud-nuke config to remove dynamodb tables

TODOs

Read the Gruntwork contribution guidelines.

  • I authored this code entirely myself
  • I am submitting code based on open source software (e.g. MIT, MPL-2.0, Apache)]
  • I am adding or upgrading a dependency or adapted code and confirm it has a compatible open source license
  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes (draft)

Added / Removed / Updated [X].

Migration Guide

Summary by CodeRabbit

  • Chores
    • Updated cloud cleanup configuration to include DynamoDB tables matching a specific pattern.
    • Expanded automated cleanup workflow to target DynamoDB tables in addition to existing AWS resources.

@coderabbitai

coderabbitai Bot commented Jul 11, 2025

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The changes update the cloud-nuke configuration and GitHub Actions workflow to include DynamoDB tables as a target resource for cleanup. A new configuration section for DynamoDB is added, and the workflow command is updated to nuke DynamoDB tables matching specific naming patterns.

Changes

File(s) Change Summary
.github/cloud-nuke/config.yml Added DynamoDB inclusion rules using a regex pattern for table names starting with "terragrunt-test".
.github/workflows/cloud-nuke.yml Updated workflow to include --resource-type dynamodb in the cloud-nuke command.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant cloud-nuke
    participant AWS

    GitHub Actions->>cloud-nuke: Run with resource types (s3, vpc, ec2, dynamodb)
    cloud-nuke->>AWS: List and identify resources matching config (incl. DynamoDB tables)
    cloud-nuke->>AWS: Delete matching S3, VPC, EC2, and DynamoDB resources
    AWS-->>cloud-nuke: Return deletion status
    cloud-nuke-->>GitHub Actions: Report results
Loading

Possibly related PRs

  • feat: Adding cloud-nuke cron #4306: Previously added the initial cloud-nuke config and workflow for S3 resources, showing a direct evolution toward broader resource coverage, now including DynamoDB.

Suggested reviewers

  • yhakbar

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@vercel

vercel Bot commented Jul 11, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
terragrunt-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2025 6:36pm

@denis256
denis256 marked this pull request as ready for review July 11, 2025 18:53
@denis256
denis256 requested review from wakeful and yhakbar as code owners July 11, 2025 18:53

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/cloud-nuke/config.yml (1)

18-21: Consider adding an explicit timeout for DynamoDB deletions

DynamoDB table deletion can exceed the default cloud-nuke timeout (10 m). Aligning with the S3 section’s timeout: 1h avoids premature failures in heavily-provisioned test accounts.

 dynamodb:
+  timeout: 1h
   include:
     table_names_regex:
       - "^terragrunt-test.*"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 35eada7 and 04bfb01.

📒 Files selected for processing (2)
  • .github/cloud-nuke/config.yml (1 hunks)
  • .github/workflows/cloud-nuke.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Pull Request has non-contributor approval
  • GitHub Check: Test (macos)
🔇 Additional comments (2)
.github/cloud-nuke/config.yml (1)

18-21: Verify the regex key in .github/cloud-nuke/config.yml

The include.table_names_regex field may be misspelled—some cloud-nuke versions expect table_name_regex (singular). A typo here will cause the include block to be ignored and all DynamoDB tables older than the global threshold to be wiped.

• File: .github/cloud-nuke/config.yml (lines 18–21)
• Current snippet:

dynamodb:
  include:
    table_names_regex:
      - "^terragrunt-test.*"

Please confirm against your pinned cloud-nuke version (v0.40.0) by running locally:

cloud-nuke help dynamodb | grep -i regex -A2

or consult the official cloud-nuke documentation to ensure you’re using the correct key.

.github/workflows/cloud-nuke.yml (1)

46-46: Resource-type added—ensure IAM role has dynamodb:DeleteTable

The assumed role (${{ secrets.CLOUD_NUKE_ROLE }}) must now allow dynamodb:DeleteTable, dynamodb:DescribeTable, and dynamodb:UpdateTable (for TTL disable). Without these, the step will error out or leave tables orphaned.

@denis256
denis256 merged commit 430df05 into main Jul 11, 2025
50 of 54 checks passed
@denis256
denis256 deleted the cloud-nuke-dynamodb branch July 11, 2025 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants