I have been attempting to start an instance of EC2 in C# without luck.
When passing in an instance id to start the instance I get an error that the instance cannot be found despite that I am passing in an instance ID that I have obtained from the object property.
I would be most grateful for any tips or pointers with this.
Try something like this with the AWSSDK to start new instances of an "image id":
(Note: The .WithUserData() is optional and is used above to pass a short shell script.)
If the call is successful the response should contain a list of instances. You can use something like this to create a list of "instance ids":
Amazon made huge efforts to integrate its AWS Cloud .Net SDK To VS2008 & VS 2010
(available from your AWS Console under your login name menu on the top right corner)
You can check the programmatic start/stop success by refreshing your AWS Console Screen.
You just need to replace "i-00000000" by your instance Id (available in your AWS Management Console)
Hope this helps those googling this and stumbling upon this question (as I did myself) start off quickly.
Following these simple steps via these wizards will spare you considerable headaches.
Be mindful that Amazon AWS instances exist only in one region.. If your instance id i-12345 is in the EU-West-1 region, and you just make a new EC2Client and tell the client to start i-12345 it may well complain that it cannot find that instance, because the client started up in the us-east-1 region, which does not have i-12345 instance
Your call that creates the cient should specify the region, if it is not the default region (I've no idea which AWS region is default, so i specify every time):
Ok, this is the FULL, end-to-end instructions. 1. Install AWSSDK.Core and AWSSDK.EC2 using Nuget Package Manager.
2. Then copy this whole class to your project. AccessKey and Secret are obtained in AWS IAM. You will need to ensure the user you create has "AmazonEC2FullAccess" (You can probably use a lower-level permission policy, I am just lazy here :D). region is your AW S EC2 instance region. and Instance ID can be found in the EC2 dashboard list. Simple, works perfectly... You can also write extra code to manage the response object. 3. Be mindful if you are behind a proxy, you will have to configure it (I havent included code here).
try this.