Search

Create Instance

Last Updated: Nov 4, 2020

Articles

Use this function to create an instance in AWS with the given details.

Syntax

Create Instance (access_key, secret_key, image_id, instance_name, location, resource_type, instance_type, keyname)

Parameters

Input Parameter Name Description
access_key AWS access_key_ID of the user
secret_key AWS Secret_access_key of the user
image_id ID of the instance in AWS
instance_name Name of instance to be created
location Location of the machine to be hosted
resource_type Resource type is “Instance”
instance_type The type of the instance
keyname Key pair name in AWS for authentication

Returns

Return Value Description
Output
  • On Success: 1, Instance ID
  • On Failure: 0, Error Message

Sample

Create Instance (XYZ, ABC, ami-000000, JiffyInstance, us-east-2, Instance, t2.nano, Key)

  • Uses the access key ‘XYZ’ and the secret key ‘ABC’ to login to AWS with image ID ‘ami-000000’, and the key name ‘Key’ to authenticate, creates an instance ‘JiffyInstance’ of type ‘t2.nano’ and resource type ‘Instance’ in the location ‘us-east-2’
    Returns the ‘Instance ID’ of the instance created.

To view all the AWS functions, click here.

Did you find what you were looking for?