Hao Wang
Hao Wang

Reputation: 43

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. I could use SSH to connect to my instance . However ,when I try to use ec2-start-instance . I failed with following bugs:

The instance ID 'i-XXXXXXXX' does not exist

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?

Upvotes: 0

Views: 91

Answers (2)

Hao Wang
Hao Wang

Reputation: 43

@Mark B I fixed because I used the wrong credentials. 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.

Thank you

Upvotes: 0

Paul Dunlop
Paul Dunlop

Reputation: 327

I suspect your answer lies in Roles. i.e. 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. Not sure that's possible?

Check into: 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."

Upvotes: 1

Related Questions