简体   繁体   English

我想使用脚本删除 IAM 用户,该脚本的前缀为“vault-”并且超过 2 天

[英]I want to delete IAM users with a script which have a prefix "vault-" to them and are older than 2 days

How do I list IAM users with aws cli which are older than 2 days and a prefix attached to them?如何使用 aws cli 列出超过 2 天并附加前缀的 IAM 用户?

aws iam list-users | jq '.Users[] | select ( .CreateDate | contains("2019-10-10") ) | select ( .UserName | startswith("vault-") ) | .UserId'

and then you can loop over results to delete the user然后你可以遍历结果来删除用户

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 React JS 删除超过 2 天的 Firestore 文档 - Delete Firestore documents older than 2 days using React JS 如何删除 Amazon S3 中超过 7 天的文件? - How to delete files older than 7 days in Amazon S3? 如何删除超过 7 天的文件但在 Amazon S3 中保留每月 1 号的最后 6 个文件? - How to delete files older than 7 days but keep last 6 files of 1st of every month in Amazon S3? 使用 PowerShell 递归删除 S3 存储桶下超过 30 天的文件而不删除文件夹 - Delete files older than 30 days under S3 bucket recursively without deleting folders using PowerShell 如何获取早于x天的rds快照列表 - How to get a list of rds snapshots older than x days 删除早于一个月的 AWS EC2 快照 - Delete older than month AWS EC2 snapshots 我只想output仪表板中的产品,其中数量少于10个。它在firestore中连接。 我该如何改进呢? - I just want to output the products in the dashboard, In which the quantity is less than 10. It is connected in the firestore. How can I improve this? 如何删除firebase最近没有登录的auth用户? - How to delete firebase auth users that have not recently signed in? AWS IAM s3:前缀 - AWS IAM s3:prefix 我想使用 AWS CDK 更新现有 IAM 角色的信任策略 - I want to update the trustpolicy of existing IAM role using AWS CDK
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM