简体   繁体   English

如何找出谁在AWS上创建ec2实例?

[英]How to find out who creates the ec2 instance on AWS?

There are a list of EC2 instances in my organization aws account. 我的组织aws帐户中有一个EC2实例列表。 I'd like to find out who creates these instances. 我想找出谁创建了这些实例。 These instances don't have any tag or meta data telling me who creates them. 这些实例没有任何标签或元数据告诉我是谁创建的。

I am using aws ec2 describe-instances which returns a list of instances information including a field OwnerId and RequesterId . 我正在使用aws ec2 describe-instances返回实例信息列表,包括字段OwnerIdRequesterId Do these fields refer to the user id? 这些字段是否引用用户ID? How can I map these id to an user id? 如何将这些ID映射到用户ID? Or is there another way to find out who created them? 还是有另一种方法找出谁创造了它们?

Amazon EC2 instances, once launched, are owned by the AWS Account. Amazon EC2实例一旦启动,便由AWS账户拥有。 They are not associated with the user that launched it. 他们启动它的用户相关联。

You can use AWS CloudTrail to view all API calls made to the account. 您可以使用AWS CloudTrail查看对该帐户进行的所有API调用。 This will include a RunInstances command that launched the instance. 这将包括启动实例的RunInstances命令。 The CloudTrail record will include details of the user/credentials that were used to issue the command. CloudTrail记录将包含用于发出命令的用户/凭证的详细信息。

The fields you mentioned do not contain this information: 您提到的字段不包含以下信息:

  • OwnerId: The ID of the AWS account that owns the reservation. OwnerId:拥有预订的AWS账户的ID。
  • RequesterId: The ID of the requester that launched the instances on your behalf (for example, AWS Management Console or Auto Scaling). RequesterId:代表您启动实例的请求者的ID(例如,AWS管理控制台或Auto Scaling)。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM