是否有AWS CLI命令可以从资源中获取用户名?
我们有在AWS中构建物品时不喜欢使用标签的人们,因此问题是我们需要确定使用资源的人的用户名,如果我们有资源,我们可以使用CLI命令arn?当然,我们可以在Cloud Trail中看,但这是一个繁琐的过程,需要一些不那么痛苦的过程。无论如何,如果有人有一个也可以正常工作的boto3脚本,我还是愿意这样做。
We have folks that don't like to use tags when building things in AWS, so the problem is we need to go ascertain the UserName of the person who used the resource, is there a CLI command that we can use if we have the resource ARN? Sure, we could look in cloud trail but that's a cumbersome process, need something less painful. I'm open to anyway to do this, if someone has a boto3 script that would work as well.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AWS中的资源与创建它的IAM实体之间没有直接的关系。
当将请求发送到AWS以创建资源(例如Amazon S3存储桶或Amazon EC2实例)时,IAM验证所使用的凭据是否有权创建资源。这些凭据可以与IAM用户,IAM角色,联合身份等相关联。
如果使请求的实体有权创建资源,则创建资源。资源与生成凭据的AWS帐户相关联。 在创建的资源与请求其创建的用户/实体之间没有任何关联。
用户和资源之间的唯一链接将是AWS CloudTrail中的记录,该记录详细介绍了API请求到创建资源,以及提出API请求的用户/实体的详细信息。
There is no direct relationship between a resource in AWS and the IAM entity that created it.
When a request is sent to AWS to create a resource (eg an Amazon S3 bucket or an Amazon EC2 instance), IAM verifies that the credentials being used have permission to create the resource. These credentials could be associated with an IAM User, IAM Role, Federated identity, etc.
If the entity making the request has permission to create the resource, then the resource is created. The resource is associated with the AWS Account that generated the credentials. There is no association stored between the resource that was created and the user/entity that requested its creation.
The only link between the user and the resource would be a record in AWS CloudTrail that details the API request to create the resource, together with details of the user/entity that made the API request.