Repository: cloudslang/cs-actions
Issue: amazon/actions/instances/RunInstancesAction.java did not seem to set instance_type default to m1.small as expected

"amazon/actions/instances/RunInstancesAction.java" did not seem to set instance_type default to m1.small (if not specified) as expected? Instead, it set to "m1_small" be default which would be rejected by AWS

1. CLI:
cslang>run --f /var/tmp/cslang-cli/content/io/cloudslang/amazon/aws/ec2/instances/run_instances.sl --i identity=xxx,credential=yyy,image_id=ami-31814f58

Operation outputs:
- return_result = <?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>InvalidParameterValue</Code...
- return_code = -1

in the execution logs:
<Response><Errors><Error><Code>InvalidParameterValue</Code><Message>Invalid value 'm1_small' for InstanceType.</Message></Error></Errors><RequestID>c6fea88c-b38f-4f69-964b-07120a8b5606</RequestID></Response>, return_code=-1, exception=, instance_id_result=}, Result: FAILURE, Raw Data: {EXECUTION_ID=101600057, PATH=0, DESCRIPTION=Execution finished running, TIMESTAMP=Thu Jun 22 20:44:53 UTC 2017, STEP_TYPE=OPERATION, STEP_NAME=run_instances, TYPE=EVENT_EXECUTION_FINISHED, RESULT=FAILURE, OUTPUTS={return_result=<?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>InvalidParameterValue</Code><Message>Invalid value **'m1_small'** for InstanceType.</Message></Error></Errors><RequestID>c6fea88c-b38f-4f69-964b-07120a8b5606</RequestID></Response>, return_code=-1, exception=, instance_id_result=}}

2. Request was good once we specified "m1.small" as the instance_type input

cslang>run --f /var/tmp/cslang-cli/content/io/cloudslang/amazon/aws/ec2/instances/run_instances.sl --i identity=xxx,credential=yyy,image_id=ami-31814f58,**instance_type=m1.small**

Operation outputs:
- return_result = <?xml version="1.0" encoding="UTF-8"?>
<RunInstancesResponse xmlns="http://ec2.amazonaws.com/doc/...
- instance_id_result = i-0f4c4353a8b194d7d
- return_code = 0
Operation: run_instances finished with result: SUCCESS


Changed files:
cs-amazon/src/main/java/io/cloudslang/content/amazon/entities/constants/Constants.java
cs-amazon/src/main/java/io/cloudslang/content/amazon/actions/instances/RunInstancesAction.java

diff --git a/cs-amazon/src/main/java/io/cloudslang/content/amazon/actions/instances/RunInstancesAction.java b/cs-amazon/src/main/java/io/cloudslang/content/amazon/actions/instances/RunInstancesAction.java
index 23658f999..86a75671c 100644
--- a/cs-amazon/src/main/java/io/cloudslang/content/amazon/actions/instances/RunInstancesAction.java
+++ b/cs-amazon/src/main/java/io/cloudslang/content/amazon/actions/instances/RunInstancesAction.java
@@ -28,6 +28,7 @@ import io.cloudslang.content.constants.ReturnCodes;
 
 import java.util.Map;
 
+import static io.cloudslang.content.amazon.entities.constants.Constants.Miscellaneous.DEFAULT_INSTANCE_TYPE;
 import static io.cloudslang.content.amazon.utils.InputsUtil.getDefaultStringInput;
 import static io.cloudslang.content.amazon.utils.OutputsUtil.putResponseIn;
 
@@ -483,6 +484,7 @@ public class RunInstancesAction {
                                        @Param(value = SECONDARY_PRIVATE_IP_ADDRESS_COUNT) String secondaryPrivateIpAddressCount) {
         try {
             version = getDefaultStringInput(version, INSTANCES_DEFAULT_API_VERSION);
+            instanceType = getDefaultStringInput(instanceType, DEFAULT_INSTANCE_TYPE);
 
             final CommonInputs commonInputs = new CommonInputs.Builder()
                     .withEndpoint(endpoint, EC2_API, EMPTY)
diff --git a/cs-amazon/src/main/java/io/cloudslang/content/amazon/entities/constants/Constants.java b/cs-amazon/src/main/java/io/cloudslang/content/amazon/entities/constants/Constants.java
index 2d536ed40..8ec6c60f1 100644
--- a/cs-amazon/src/main/java/io/cloudslang/content/amazon/entities/constants/Constants.java
+++ b/cs-amazon/src/main/java/io/cloudslang/content/amazon/entities/constants/Constants.java
@@ -54,6 +54,7 @@ public class Constants {
         public static final String NOT_RELEVANT = "Not relevant";
         public static final String PIPE_DELIMITER = "|";
         public static final String SCOPE_SEPARATOR = "/";
+        public static final String DEFAULT_INSTANCE_TYPE = "m1.small";
     }
 
     public static class Values {