n8nflow.net logo

Clean Up Expired AWS ACM Certificates with Slack Approval

by Trung Tranโ€ขUpdated: Last update 17 days agoโ€ขSource: n8n.io
Loading workflow viewer...

Getting Started

Automatic Clean Up Expired AWS ACM Certificates with Human Approval

Automate the cleanup of expired AWS ACM certificates with Slack-based approval. This workflow helps maintain a secure and tidy AWS environment by detecting expired SSL certs, sending detailed Slack notifications to admins, and deleting them upon approval, ensuring full visibility and control over certificate lifecycle management.

๐Ÿง‘โ€๐Ÿ’ผ Whoโ€™s it for

This workflow is designed for:

  • AWS administrators who want to keep their environment clean and secure
  • DevOps teams managing SSL lifecycle in AWS ACM
  • IT Admins needing visibility and control over expired cert removal
  • Teams that use Slack for collaboration and approvals

โš™๏ธ How it works / What it does

This automated workflow performs the following tasks on a daily schedule :

  1. Fetch all ACM certificates in your AWS account.
  2. Filter out the expired ones by comparing expiration date and status.
  3. Send a Slack approval message with certificate details to the admin team.
  4. Wait for approval response directly in Slack (โœ… to approve deletion).
  5. If approved, it deletes the expired certificate using AWS ACM.
  6. Finally, it notifies the IT admin about the action taken.

๐Ÿ”ง How to set up

  1. Create the Workflow

    • Add the nodes as shown:
      • Schedule Trigger
      • AWS - ACM: listCertificates
      • AWS - ACM: describeCertificate (loop per cert)
      • IF Node to filter expired certs
      • Slack - Send & Wait for Reaction
      • AWS - ACM: deleteCertificate
      • Slack - Post Message to notify
  2. Configure Slack

    • Create a Slack Bot Token with:
      • chat:write
      • reactions:read
      • channels:read
    • Connect it in your Slack nodes.
  3. Configure AWS Credentials

    • Use IAM User or Role with:
      • acm:ListCertificates
      • acm:DescribeCertificate
      • acm:DeleteCertificate
  4. Set schedule

    • Daily, Weekly, or custom cron expression.

๐Ÿ“‹ Requirements

ComponentDescription
AWS ACM AccessIAM permissions for ACM actions
Slack Bot TokenWith chat:write & reactions:read
n8n EnvironmentSelf-hosted or n8n Cloud
Slack ChannelWhere approval messages will be sent

๐Ÿ› ๏ธ How to customize the workflow

๐Ÿ•’ Change waiting time

Adjust the wait time before checking Slack reactions in the sendAndWait node (default 1 hour).

๐Ÿ‘ฅ Change Slack target

Change the Slack channel or tag specific people (<@U123456>).

๐Ÿ““ Add logging

Add Google Sheets, Notion, or DynamoDB to log certificate details and approval decisions.

๐Ÿงช Add dry-run/test mode

Use an IF node before deletion to simulate removal when ENV === dry-run.