public String handleRequest(String input, Context context) {
context.getLogger().log("Input: " + input);
@SuppressWarnings("serial")
Hashtable<String, String> htAWSServices =
new Hashtable <String, String> (){{
put("Compute","For Compute - please insert like Compute1/.../Compute6");
put("Compute1","AWS Lambda(Compute)");
put("Compute2","AWS EC2(Compute)");
put("Compute3","AWS EC2 Container Service(Compute)");
put("Compute4","AWS Lightsail(Compute)");
put("Compute5","AWS Elastic Beanstalk(Compute)");
put("Compute6","AWS Batch(Compute)");
put("Analytics","For Analytics - please insert like Analytics1/.../Analytics8");
put("Analytics1","AWS Athena(Analytics)");
put("Analytics2","AWS EMR(Analytics)");
put("Analytics3","AWS CloudSearch(Analytics)");
put("Analytics4","AWS Elasticsearch Service(Analytics)");
put("Analytics5","AWS Kinesis(Analytics)");
put("Analytics6","AWS Data Pipeline(Analytics)");
put("Analytics7","AWS QuickSight(Analytics)");
put("Analytics8","AWS Glue(Analytics)");
}};
String stOutput = "";
String stValue = htAWSServices.get(input);
if (stValue == null)
stOutput = "Hello from Lambda!, "+input+"!";
else
stOutput = "Hello AWS has "+stValue+"!";
return stOutput;
}
现在我将API网关中的键值传递给Lambda函数吗?