8
n8n 中文网amn8n.com

清理过期的 AWS ACM 证书并需 Slack 批准

中级

这是一个DevOps, Multimodal AI领域的自动化工作流,包含 14 个节点。主要使用 Slack, Filter, ScheduleTrigger, AwsCertificateManager 等节点。 通过 Slack 批准清理过期的 AWS ACM 证书

前置要求
  • Slack Bot Token 或 Webhook URL
  • AWS Access Key 和 Secret
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "ISewUDgaQCM3Lw59",
  "meta": {
    "instanceId": "4a2e6764ba7a6bc9890d9225f4b21d570ce88fc9bd57549c89057fcee58fed0f",
    "templateCredsSetupCompleted": true
  },
  "name": "清理过期的 AWS ACM 证书并需 Slack 批准",
  "tags": [
    {
      "id": "ZWDTpzMgM2j0ZGMO",
      "name": "acm",
      "createdAt": "2025-08-20T04:24:13.252Z",
      "updatedAt": "2025-08-20T04:24:13.252Z"
    },
    {
      "id": "hvp6nueQ4hpIJWbY",
      "name": "aws",
      "createdAt": "2025-08-17T05:47:27.209Z",
      "updatedAt": "2025-08-17T05:47:27.209Z"
    }
  ],
  "nodes": [
    {
      "id": "0fa56096-8872-400b-afa1-5c52090bd33c",
      "name": "获取多个证书",
      "type": "n8n-nodes-base.awsCertificateManager",
      "position": [
        224,
        0
      ],
      "parameters": {
        "options": {},
        "operation": "getMany"
      },
      "credentials": {
        "aws": {
          "id": "IZYsJuHhfVJ3PIrC",
          "name": "ap-southeast-1"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "849ac135-f381-4a26-a9c5-79e62d20f74d",
      "name": "发送消息并等待回复",
      "type": "n8n-nodes-base.slack",
      "disabled": true,
      "position": [
        720,
        0
      ],
      "webhookId": "a2040fd8-4de2-4eb9-ad51-fa9a5b974afc",
      "parameters": {
        "user": {
          "__rl": true,
          "mode": "list",
          "value": "U054RMBTVBM",
          "cachedResultName": "trung.tran"
        },
        "message": "=:warning: *Expired SSL Certificate Detected*\nAn SSL certificate in AWS ACM has expired. Please review the details below and approve deletion to keep the environment clean.\n*📄 Certificate Summary:*\n• *Domain Name:* `{{ $json.DomainName }}`\n• *Certificate ARN:* `{{ $json.CertificateArn }}`\n• *Issueed Date:* `{{ $json.IssuedAt.toDateTime('s').toString() }}`\n• *Expiration Date:* `{{ $json.NotAfter.toDateTime('s').toString() }}`\n\n👉 *Next Step:*  \nReact to this message with:\n:white_check_mark: to approve deletion  \n:x: to keep the certificate\n\n_(This message will be auto-checked in 1 hour for reactions.)_",
        "options": {
          "limitWaitTime": {
            "values": {
              "resumeUnit": "minutes",
              "resumeAmount": 60
            }
          }
        },
        "operation": "sendAndWait",
        "authentication": "oAuth2",
        "approvalOptions": {
          "values": {
            "approvalType": "double"
          }
        }
      },
      "credentials": {
        "slackOAuth2Api": {
          "id": "4JSKt9sIRV1KGswQ",
          "name": "Slack account"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "203fe369-3299-46e3-a076-99d0b8dd1c00",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1264,
        -672
      ],
      "parameters": {
        "width": 1056,
        "height": 1744,
        "content": "# 清理过期的 AWS ACM 证书并需人工批准"
      },
      "typeVersion": 1
    },
    {
      "id": "4539a804-c2ca-4591-9b7c-5c018cffdf97",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -176,
        192
      ],
      "parameters": {
        "width": 272,
        "height": 128,
        "content": "### 1. 计划触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "0333abeb-5624-4b50-a25e-15ea74211a5a",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        192
      ],
      "parameters": {
        "width": 208,
        "content": "### 2. 获取证书"
      },
      "typeVersion": 1
    },
    {
      "id": "b09e50cd-01bd-4901-ad4c-136d30352564",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        192
      ],
      "parameters": {
        "width": 192,
        "content": "### 3. 仅筛选过期证书"
      },
      "typeVersion": 1
    },
    {
      "id": "0084a198-5701-4af9-b009-293951900c2a",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        192
      ],
      "parameters": {
        "height": 176,
        "content": "### 4. 通过 Slack 通知并等待批准"
      },
      "typeVersion": 1
    },
    {
      "id": "0c6903b4-8ddc-4c94-bb11-9e2ef518e5a9",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        896,
        192
      ],
      "parameters": {
        "width": 304,
        "content": "### 5. 删除过期证书"
      },
      "typeVersion": 1
    },
    {
      "id": "079cb3e6-73cc-41ad-95a5-c0af457b25bf",
      "name": "通知 IT 管理员",
      "type": "n8n-nodes-base.slack",
      "position": [
        1296,
        0
      ],
      "webhookId": "7ea60ebd-bef7-4a22-ba58-4009b32b63b4",
      "parameters": {
        "text": "=:white_check_mark: *ACM Certificate Deleted Successfully*\n\n*Domain:* {{ $('Get expired certification only').item.json.DomainName }}\n*ARN:* {{ $('Get expired certification only').item.json.CertificateArn }}\n*Deleted At:* {{ $now }}\n\nApproved by: {{ $('Send message and wait for response').item.json.user?.name || $('Send message and wait for response').item.json.username || 'N/A' }}",
        "user": {
          "__rl": true,
          "mode": "list",
          "value": "U054RMBTVBM",
          "cachedResultName": "trung.tran"
        },
        "select": "user",
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "id": "4JSKt9sIRV1KGswQ",
          "name": "Slack account"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "347da160-cca8-4d35-9e50-64f538dd4b46",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        -496
      ],
      "parameters": {
        "width": 608,
        "height": 416,
        "content": "![](https://wisestackai.s3.ap-southeast-1.amazonaws.com/Screenshot+2025-08-20+at+11.31.13%E2%80%AFAM.png)"
      },
      "typeVersion": 1
    },
    {
      "id": "8a2d6219-969d-4b6f-9c1b-9c818f12e9c0",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        192
      ],
      "parameters": {
        "content": "### 6. 通过 Slack 通知管理员"
      },
      "typeVersion": 1
    },
    {
      "id": "58b1a7e2-765c-4fe7-8831-cdab2eda3932",
      "name": "仅获取过期证书",
      "type": "n8n-nodes-base.filter",
      "position": [
        448,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "fe1b749d-3046-465e-b60a-786f5b0e2f99",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.Status }}",
              "rightValue": "=EXPIRED"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "c948316a-c28f-40b0-a320-927efbd8883b",
      "name": "每日计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ebb985a7-ba79-4690-8892-976b19fe2941",
      "name": "删除证书",
      "type": "n8n-nodes-base.awsCertificateManager",
      "position": [
        992,
        0
      ],
      "parameters": {
        "operation": "delete",
        "certificateArn": "={{ $json.CertificateArn }}"
      },
      "credentials": {
        "aws": {
          "id": "d62669OP9bvnmE4n",
          "name": "us-east-1"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "bfa1e782-637f-49eb-8c58-fbd6e4540d77",
  "connections": {
    "Delete a certificate": {
      "main": [
        [
          {
            "node": "Inform IT Admin",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many certificates": {
      "main": [
        [
          {
            "node": "Get expired certification only",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get many certificates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get expired certification only": {
      "main": [
        [
          {
            "node": "Send message and wait for response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send message and wait for response": {
      "main": [
        [
          {
            "node": "Delete a certificate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 开发运维, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量14
分类2
节点类型5
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Trung Tran

Trung Tran

@trungtran

Empowering small and medium businesses with smart automation and practical AI, no big tech team required.

外部链接
在 n8n.io 查看

分享此工作流