diff --git a/.aws-sam/build/HelloWorldFunction/helloworld/App.class b/.aws-sam/build/HelloWorldFunction/helloworld/App.class index 491c8fe..1107642 100644 Binary files a/.aws-sam/build/HelloWorldFunction/helloworld/App.class and b/.aws-sam/build/HelloWorldFunction/helloworld/App.class differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/annotations-2.14.14.jar b/.aws-sam/build/HelloWorldFunction/lib/annotations-2.14.14.jar new file mode 100644 index 0000000..8369176 Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/annotations-2.14.14.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/apache-client-2.14.14.jar b/.aws-sam/build/HelloWorldFunction/lib/apache-client-2.14.14.jar new file mode 100644 index 0000000..8e248d2 Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/apache-client-2.14.14.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/auth-2.14.14.jar b/.aws-sam/build/HelloWorldFunction/lib/auth-2.14.14.jar new file mode 100644 index 0000000..7c5dd14 Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/auth-2.14.14.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/aws-core-2.14.14.jar b/.aws-sam/build/HelloWorldFunction/lib/aws-core-2.14.14.jar new file mode 100644 index 0000000..e6e447b Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/aws-core-2.14.14.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/aws-json-protocol-2.14.14.jar b/.aws-sam/build/HelloWorldFunction/lib/aws-json-protocol-2.14.14.jar new file mode 100644 index 0000000..eebf7e9 Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/aws-json-protocol-2.14.14.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/aws-lambda-java-core-1.2.0.jar b/.aws-sam/build/HelloWorldFunction/lib/aws-lambda-java-core-1.2.0.jar deleted file mode 100644 index 2f7af34..0000000 Binary files a/.aws-sam/build/HelloWorldFunction/lib/aws-lambda-java-core-1.2.0.jar and /dev/null differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/aws-lambda-java-core-1.2.1.jar b/.aws-sam/build/HelloWorldFunction/lib/aws-lambda-java-core-1.2.1.jar new file mode 100644 index 0000000..bc49124 Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/aws-lambda-java-core-1.2.1.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/aws-lambda-java-log4j2-1.2.0.jar b/.aws-sam/build/HelloWorldFunction/lib/aws-lambda-java-log4j2-1.2.0.jar new file mode 100644 index 0000000..e2558a8 Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/aws-lambda-java-log4j2-1.2.0.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/commons-logging-1.1.3.jar b/.aws-sam/build/HelloWorldFunction/lib/commons-logging-1.1.3.jar deleted file mode 100644 index ab51254..0000000 Binary files a/.aws-sam/build/HelloWorldFunction/lib/commons-logging-1.1.3.jar and /dev/null differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/commons-logging-1.2.jar b/.aws-sam/build/HelloWorldFunction/lib/commons-logging-1.2.jar new file mode 100644 index 0000000..93a3b9f Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/commons-logging-1.2.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/eventstream-1.0.1.jar b/.aws-sam/build/HelloWorldFunction/lib/eventstream-1.0.1.jar new file mode 100644 index 0000000..6397d93 Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/eventstream-1.0.1.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/http-client-spi-2.14.14.jar b/.aws-sam/build/HelloWorldFunction/lib/http-client-spi-2.14.14.jar new file mode 100644 index 0000000..d6fcf70 Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/http-client-spi-2.14.14.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/ion-java-1.7.1.jar b/.aws-sam/build/HelloWorldFunction/lib/ion-java-1.7.1.jar new file mode 100644 index 0000000..c50141b Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/ion-java-1.7.1.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/jackson-annotations-2.10.4.jar b/.aws-sam/build/HelloWorldFunction/lib/jackson-annotations-2.10.4.jar new file mode 100644 index 0000000..941440b Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/jackson-annotations-2.10.4.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/jackson-annotations-2.6.0.jar b/.aws-sam/build/HelloWorldFunction/lib/jackson-annotations-2.6.0.jar deleted file mode 100644 index 0a18c34..0000000 Binary files a/.aws-sam/build/HelloWorldFunction/lib/jackson-annotations-2.6.0.jar and /dev/null differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/jackson-core-2.10.0.jar b/.aws-sam/build/HelloWorldFunction/lib/jackson-core-2.10.4.jar similarity index 58% rename from .aws-sam/build/HelloWorldFunction/lib/jackson-core-2.10.0.jar rename to .aws-sam/build/HelloWorldFunction/lib/jackson-core-2.10.4.jar index 7e33c11..ef99435 100644 Binary files a/.aws-sam/build/HelloWorldFunction/lib/jackson-core-2.10.0.jar and b/.aws-sam/build/HelloWorldFunction/lib/jackson-core-2.10.4.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/jackson-databind-2.10.4.jar b/.aws-sam/build/HelloWorldFunction/lib/jackson-databind-2.10.4.jar new file mode 100644 index 0000000..87f8f00 Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/jackson-databind-2.10.4.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/jackson-databind-2.6.7.3.jar b/.aws-sam/build/HelloWorldFunction/lib/jackson-databind-2.6.7.3.jar deleted file mode 100644 index ef519d3..0000000 Binary files a/.aws-sam/build/HelloWorldFunction/lib/jackson-databind-2.6.7.3.jar and /dev/null differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/lambda-2.14.14.jar b/.aws-sam/build/HelloWorldFunction/lib/lambda-2.14.14.jar new file mode 100644 index 0000000..e23da37 Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/lambda-2.14.14.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/log4j-api-2.13.2.jar b/.aws-sam/build/HelloWorldFunction/lib/log4j-api-2.13.2.jar new file mode 100644 index 0000000..afc89ff Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/log4j-api-2.13.2.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/log4j-core-2.13.2.jar b/.aws-sam/build/HelloWorldFunction/lib/log4j-core-2.13.2.jar new file mode 100644 index 0000000..9b6bdff Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/log4j-core-2.13.2.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/logback-classic-1.1.2.jar b/.aws-sam/build/HelloWorldFunction/lib/logback-classic-1.1.2.jar new file mode 100644 index 0000000..9230b2a Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/logback-classic-1.1.2.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/logback-core-1.1.2.jar b/.aws-sam/build/HelloWorldFunction/lib/logback-core-1.1.2.jar new file mode 100644 index 0000000..391da64 Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/logback-core-1.1.2.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/metrics-spi-2.14.14.jar b/.aws-sam/build/HelloWorldFunction/lib/metrics-spi-2.14.14.jar new file mode 100644 index 0000000..f0e25e6 Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/metrics-spi-2.14.14.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/profiles-2.14.14.jar b/.aws-sam/build/HelloWorldFunction/lib/profiles-2.14.14.jar new file mode 100644 index 0000000..335c4aa Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/profiles-2.14.14.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/protocol-core-2.14.14.jar b/.aws-sam/build/HelloWorldFunction/lib/protocol-core-2.14.14.jar new file mode 100644 index 0000000..e170bf8 Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/protocol-core-2.14.14.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/reactive-streams-1.0.2.jar b/.aws-sam/build/HelloWorldFunction/lib/reactive-streams-1.0.2.jar new file mode 100644 index 0000000..8e8a9ce Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/reactive-streams-1.0.2.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/regions-2.14.14.jar b/.aws-sam/build/HelloWorldFunction/lib/regions-2.14.14.jar new file mode 100644 index 0000000..d7b5794 Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/regions-2.14.14.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/sdk-core-2.14.14.jar b/.aws-sam/build/HelloWorldFunction/lib/sdk-core-2.14.14.jar new file mode 100644 index 0000000..b8a69c5 Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/sdk-core-2.14.14.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/slf4j-api-1.7.7.jar b/.aws-sam/build/HelloWorldFunction/lib/slf4j-api-1.7.7.jar new file mode 100644 index 0000000..bebabd9 Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/slf4j-api-1.7.7.jar differ diff --git a/.aws-sam/build/HelloWorldFunction/lib/utils-2.14.14.jar b/.aws-sam/build/HelloWorldFunction/lib/utils-2.14.14.jar new file mode 100644 index 0000000..0598ab3 Binary files /dev/null and b/.aws-sam/build/HelloWorldFunction/lib/utils-2.14.14.jar differ diff --git a/.aws-sam/build/template.yaml b/.aws-sam/build/template.yaml index 76b4436..fc0cb36 100644 --- a/.aws-sam/build/template.yaml +++ b/.aws-sam/build/template.yaml @@ -17,12 +17,19 @@ Resources: Runtime: java11 Policies: - AmazonDynamoDBFullAccess + - Statement: + - Sid: codeguruprofileragentpolicy + Effect: Allow + Action: + - codeguru-profiler:ConfigureAgent + - codeguru-profiler:PostAgentProfile + Resource: arn:aws:codeguru-profiler:us-west-2:079760242939:profilingGroup/DemoProfiler MemorySize: 512 Environment: Variables: PARAM1: VALUE AWS_CODEGURU_PROFILER_GROUP_ARN: arn:aws:codeguru-profiler:us-west-2:079760242939:profilingGroup/DemoProfiler - AWS_CODEGURU_PROFILER_ENABLED: true + AWS_CODEGURU_PROFILER_ENABLED: 'TRUE' Events: HelloWorld: Type: HttpApi diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c5f3f6b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.configuration.updateBuildConfiguration": "interactive" +} \ No newline at end of file diff --git a/HelloWorldFunction/.classpath b/HelloWorldFunction/.classpath new file mode 100644 index 0000000..9ba41a2 --- /dev/null +++ b/HelloWorldFunction/.classpath @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HelloWorldFunction/.factorypath b/HelloWorldFunction/.factorypath new file mode 100644 index 0000000..c273cbe --- /dev/null +++ b/HelloWorldFunction/.factorypath @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HelloWorldFunction/.project b/HelloWorldFunction/.project new file mode 100644 index 0000000..e3bb720 --- /dev/null +++ b/HelloWorldFunction/.project @@ -0,0 +1,34 @@ + + + HelloWorld + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + + + 1599826166907 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/HelloWorldFunction/.settings/org.eclipse.jdt.apt.core.prefs b/HelloWorldFunction/.settings/org.eclipse.jdt.apt.core.prefs new file mode 100644 index 0000000..687ad91 --- /dev/null +++ b/HelloWorldFunction/.settings/org.eclipse.jdt.apt.core.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.apt.aptEnabled=true +org.eclipse.jdt.apt.genSrcDir=target\\generated-sources\\annotations +org.eclipse.jdt.apt.genTestSrcDir=target\\generated-test-sources\\test-annotations diff --git a/HelloWorldFunction/.settings/org.eclipse.jdt.core.prefs b/HelloWorldFunction/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..2985089 --- /dev/null +++ b/HelloWorldFunction/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,9 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.processAnnotations=enabled +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/HelloWorldFunction/.settings/org.eclipse.m2e.core.prefs b/HelloWorldFunction/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/HelloWorldFunction/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/HelloWorldFunction/pom.xml b/HelloWorldFunction/pom.xml index 1cbcba3..3b1042c 100644 --- a/HelloWorldFunction/pom.xml +++ b/HelloWorldFunction/pom.xml @@ -20,26 +20,80 @@ 1.11.119 - - com.amazonaws - aws-lambda-java-core - 1.2.0 - - - com.amazonaws - codeguru-profiler-java-agent - 1.0.1 - - - junit - junit - 4.12 - test - - - com.amazonaws - aws-java-sdk-dynamodb - + + software.amazon.awssdk + auth + + + com.amazonaws + aws-lambda-java-core + 1.2.1 + + + software.amazon.awssdk + regions + + + com.amazonaws + aws-lambda-java-log4j2 + 1.2.0 + + + software.amazon.awssdk + aws-core + + + software.amazon.awssdk + apache-client + + + software.amazon.awssdk + protocol-core + + + software.amazon.awssdk + aws-json-protocol + + + org.slf4j + slf4j-api + 1.7.7 + + + ch.qos.logback + logback-classic + 1.1.2 + + + org.slf4j + slf4j-api + + + + + com.amazonaws + codeguru-profiler-java-agent + 1.0.1 + + + junit + junit + 4.12 + test + + + com.amazonaws + aws-java-sdk-dynamodb + + + com.amazon.ion + ion-java + 1.7.1 + + + software.amazon.awssdk + lambda + @@ -50,6 +104,13 @@ pom import + + software.amazon.awssdk + bom + 2.14.14 + pom + import + diff --git a/HelloWorldFunction/src/main/java/helloworld/App.java b/HelloWorldFunction/src/main/java/helloworld/App.java index 47f4194..3e1173e 100644 --- a/HelloWorldFunction/src/main/java/helloworld/App.java +++ b/HelloWorldFunction/src/main/java/helloworld/App.java @@ -22,102 +22,109 @@ import com.amazonaws.services.dynamodbv2.model.ResourceNotFoundException; import java.util.ArrayList; +//import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider; import software.amazon.codeguruprofilerjavaagent.LambdaProfiler; - - +//import software.amazon.codeguruprofilerjavaagent.RequestHandlerWithProfiling; import java.util.UUID; + /** * Handler for requests to Lambda function. */ public class App implements RequestHandler { +//public class App extends RequestHandlerWithProfiling, String> { @Override - public Object handleRequest(final Object input, final Context context) { + public Object handleRequest( Object input, Context context) { return LambdaProfiler.profile(input, context, this::myHandlerFunction); } - public Object myHandlerFunction(final Object input, final Context context) { + +/* @Override + public String requestHandler(Map input, Context context) { + // Your function code here + GatewayResponse result = (GatewayResponse) this.myHandlerFunction(input, context); + return String.format("status code:\"%d\", body:\"%s\"", result.getStatusCode(), result.getBody()); + } +*/ + public Object myHandlerFunction( Object input, Context context) { Map headers = new HashMap<>(); headers.put("Content-Type", "application/json"); headers.put("X-Custom-Header", "application/json"); try { - final String pageContents = this.getPageContents("https://checkip.amazonaws.com"); + String pageContents = this.getPageContents("https://checkip.amazonaws.com"); UUID id = UUID.randomUUID(); - final String ddbtestput = this.PutItem("HelloWorldTable", "id", id.toString(), "field1", "stringValue1"); - final String ddbtestget = this.GetItem("HelloWorldTable", "id", id.toString() ); + String ddbtestput = this.PutItem("HelloWorldTable", "id", id.toString(), "field1", "stringValue1"); + String ddbtestget = this.GetItem("HelloWorldTable", "id", id.toString()); - String output = String.format("{ \"message\": \"hello world\", \"location\": \"%s\" \n \"put\":\"%s\"-\"%s\" \n \"get\":\"%s\"-\"%s\"}", pageContents,id.toString(),ddbtestput,id.toString(),ddbtestget); + String output = String.format( + "{ \"message\": \"hello world\", \"location\": \"%s\" \n \"put\":\"%s\"-\"%s\" \n \"get\":\"%s\"-\"%s\"}", + pageContents, id.toString(), ddbtestput, id.toString(), ddbtestget); return new GatewayResponse(output, headers, 200); } catch (IOException e) { return new GatewayResponse("{}", headers, 500); } } - private String getPageContents(String address) throws IOException{ + private String getPageContents(String address) throws IOException { URL url = new URL(address); - try(BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()))) { + try (BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()))) { return br.lines().collect(Collectors.joining(System.lineSeparator())); } } - private String GetItem(String TableName, String PrimaryKey, String Value) //throws AmazonServiceException + private String GetItem(String TableName, String PrimaryKey, String Value) // throws + // AmazonServiceException { - HashMap key_to_get = - new HashMap(); - + HashMap key_to_get = new HashMap(); + key_to_get.put(PrimaryKey, new AttributeValue(Value)); - + GetItemRequest request = null; - request = new GetItemRequest() - .withKey(key_to_get) - .withTableName(TableName); - - final AmazonDynamoDB ddb = AmazonDynamoDBClientBuilder.defaultClient(); - + request = new GetItemRequest().withKey(key_to_get).withTableName(TableName); + + AmazonDynamoDB ddb = AmazonDynamoDBClientBuilder.defaultClient(); + try { - Map returned_item = - ddb.getItem(request).getItem(); + Map returned_item = ddb.getItem(request).getItem(); if (returned_item != null) { Set keys = returned_item.keySet(); - String output; - for (String key : keys) { - System.out.format("%s: %s\n", - key, returned_item.get(key).toString()); + //String output; + for ( String key : keys) { + System.out.format("%s: %s\n", key, returned_item.get(key).toString()); } return returned_item.toString(); - + } else { System.out.format("No item found with the key %s!\n", Value); } } catch (AmazonServiceException e) { System.err.println(e.getErrorMessage()); - //System.exit(1); - return(e.getErrorMessage()); + // System.exit(1); + return (e.getErrorMessage()); } - return ""; - + return "successfully put item"; + } - private String PutItem(String TableName,String PrimaryKey, String PrimaryKeyValue, String Key, String Value) //throws AmazonServiceException,ResourceNotFoundException + private String PutItem(String TableName, String PrimaryKey, String PrimaryKeyValue, String Key, String Value) // throws AmazonServiceException,ResourceNotFoundException { - HashMap item_values = - new HashMap(); - + HashMap item_values = new HashMap(); + item_values.put(PrimaryKey, new AttributeValue(PrimaryKeyValue)); item_values.put(Key, new AttributeValue(Value)); - - final AmazonDynamoDB ddb = AmazonDynamoDBClientBuilder.defaultClient(); - + + AmazonDynamoDB ddb = AmazonDynamoDBClientBuilder.defaultClient(); + try { ddb.putItem(TableName, item_values); } catch (ResourceNotFoundException e) { System.err.format("Error: The table \"%s\" can't be found.\n", TableName); System.err.println("Be sure that it exists and that you've typed its name correctly!"); return e.getMessage(); - //System.exit(1); - + // System.exit(1); + } catch (AmazonServiceException e) { System.err.println(e.getMessage()); return e.getMessage(); diff --git a/HelloWorldFunction/src/test/java/helloworld/AppTest.java b/HelloWorldFunction/src/test/java/helloworld/AppTest.java index e64bdfc..2c0d147 100644 --- a/HelloWorldFunction/src/test/java/helloworld/AppTest.java +++ b/HelloWorldFunction/src/test/java/helloworld/AppTest.java @@ -9,7 +9,8 @@ public class AppTest { @Test public void successfulResponse() { App app = new App(); - GatewayResponse result = (GatewayResponse) app.handleRequest(null, null); + GatewayResponse result = (GatewayResponse) app.myHandlerFunction(null, null); + //result = app.requestHandler(null, null); assertEquals(result.getStatusCode(), 200); assertEquals(result.getHeaders().get("Content-Type"), "application/json"); String content = result.getBody(); diff --git a/HelloWorldFunction/target/classes/helloworld/App.class b/HelloWorldFunction/target/classes/helloworld/App.class new file mode 100644 index 0000000..fe7d75d Binary files /dev/null and b/HelloWorldFunction/target/classes/helloworld/App.class differ diff --git a/HelloWorldFunction/target/classes/helloworld/GatewayResponse.class b/HelloWorldFunction/target/classes/helloworld/GatewayResponse.class new file mode 100644 index 0000000..f054a69 Binary files /dev/null and b/HelloWorldFunction/target/classes/helloworld/GatewayResponse.class differ diff --git a/HelloWorldFunction/target/test-classes/helloworld/AppTest.class b/HelloWorldFunction/target/test-classes/helloworld/AppTest.class new file mode 100644 index 0000000..827fe94 Binary files /dev/null and b/HelloWorldFunction/target/test-classes/helloworld/AppTest.class differ diff --git a/debug.log b/debug.log new file mode 100644 index 0000000..6569e8e --- /dev/null +++ b/debug.log @@ -0,0 +1,2 @@ +[0911/210847.760:ERROR:registration_protocol_win.cc(103)] CreateFile: ÁöÁ¤µÈ ÆÄÀÏÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù. (0x2) +[0911/210848.829:ERROR:registration_protocol_win.cc(103)] CreateFile: ÁöÁ¤µÈ ÆÄÀÏÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù. (0x2) diff --git a/template.yaml b/template.yaml index 393bc21..01315a0 100644 --- a/template.yaml +++ b/template.yaml @@ -19,12 +19,19 @@ Resources: Runtime: java11 Policies: - AmazonDynamoDBFullAccess + - Statement: + - Sid: "codeguruprofileragentpolicy" + Effect: Allow + Action: + - codeguru-profiler:ConfigureAgent + - codeguru-profiler:PostAgentProfile + Resource: "arn:aws:codeguru-profiler:us-west-2:079760242939:profilingGroup/DemoProfiler" MemorySize: 512 Environment: # More info about Env Vars: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#environment-object Variables: PARAM1: VALUE AWS_CODEGURU_PROFILER_GROUP_ARN: arn:aws:codeguru-profiler:us-west-2:079760242939:profilingGroup/DemoProfiler - AWS_CODEGURU_PROFILER_ENABLED: TRUE + AWS_CODEGURU_PROFILER_ENABLED: "TRUE" Events: HelloWorld: Type: HttpApi # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api diff --git a/test.ps1 b/test.ps1 new file mode 100644 index 0000000..d3de8f3 --- /dev/null +++ b/test.ps1 @@ -0,0 +1,10 @@ +$i = 1 +$number = 300 +do{ + curl "https://3yht482qpi.execute-api.us-west-2.amazonaws.com/hello" + sleep 10 + $i++ + echo $i +} + +while ($i -le $number) \ No newline at end of file