简体   繁体   English

ec2实例之间的连接

[英]connection between ec2 instances

I try to use one AWS EC2 instance to start another EC2 instance automatically so that it could be started automatically if this monitoring EC2 instance keeps running. 我尝试使用一个AWS EC2实例自动启动另一个EC2实例,以便在此监视EC2实例保持运行的情况下可以自动启动它。 I could use SSH to connect to my instance . 我可以使用SSH连接到我的实例。 However ,when I try to use ec2-start-instance . 但是,当我尝试使用ec2-start-instance时。 I failed with following bugs: 我因以下错误而失败:

The instance ID 'i-XXXXXXXX' does not exist 实例ID“ i-XXXXXXXX”不存在

These two instances are in different availability zone so I think it is networking settings problem but I don't know how to solve it.Anyone could help me? 这两个实例位于不同的可用区域,因此我认为这是网络设置问题,但我不知道如何解决。有人可以帮助我吗?

I suspect your answer lies in Roles. 我怀疑您的答案在于角色。 ie Account A's EC2 instance needs to have a Role Right on Account B to start EC2 instances in Account B. And it needs to somehow be assigned this role. 即,帐户A的EC2实例需要在帐户B上具有角色权限才能在帐户B中启动EC2实例。并且需要以某种方式分配此角色。 Not sure that's possible? 不确定有可能吗?

Check into: http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html 签入: http : //docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html

"The access policy for the role specifies what the role allows someone to do. For example, you could specify that the role allows someone to manage only your Amazon EC2 and Amazon RDS resources but not your IAM users or groups. In our sample scenario, you use the access policy to give Example Corp read-only access to all of the resources in your account." “角色的访问策略指定了角色允许某人执行的操作。例如,您可以指定该角色允许某人仅管理您的Amazon EC2和Amazon RDS资源,而不管理您的IAM用户或组。在我们的示例场景中,您可以使用访问策略为Example Corp授予对帐户中所有资源的只读访问权限。”

@Mark BI fixed because I used the wrong credentials. @Mark BI已修复,因为我使用了错误的凭据。 One AWS account was set up for my personal website and the other was other uses so I considered using this continuously running instance to do something for me. 为我的个人网站设置了一个AWS账户,另一个用于其他用途,因此我考虑使用此连续运行的实例为我做些事情。

Thank you 谢谢

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

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