File tree 1 file changed +8
-4
lines changed
awslambdalist/src/main/java/example
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 7
7
8
8
package example ;
9
9
10
- import java .io .IOException ;
11
10
import software .amazon .awssdk .core .exception .SdkException ;
12
11
import software .amazon .awssdk .awscore .exception .AwsServiceException ;
13
12
import software .amazon .awssdk .regions .Region ;
16
15
import software .amazon .awssdk .services .lambda .model .GetFunctionConfigurationResponse ;
17
16
import software .amazon .awssdk .services .lambda .model .ServiceException ;
18
17
18
+
19
19
public class LambdaList {
20
20
private static final Region REGION = Region .of ("eu-west-1" ); // Region name
21
21
22
- public static void main (String [] args ) throws IOException {
22
+ public static void main (String [] args ) {
23
23
24
24
if (args .length < 1 ) {
25
- System .out .println ("Not enough parameters.\n Proper Usage is: java -jar lambdalist.jar <FUNCTION_NAME>" );
25
+ System .out .println ("Not enough parameters.\n " +
26
+ "Proper Usage is: java -jar lambdalist.jar <FUNCTION_NAME>" );
26
27
System .exit (1 );
27
28
}
28
29
29
30
String functionName = args [0 ];
30
31
31
32
System .out .println ("Lambda function name: " + functionName );
32
33
34
+ LambdaClient awsLambda = LambdaClient .builder ().region (REGION ).build ();
35
+
33
36
try {
34
- LambdaClient awsLambda = LambdaClient . builder (). region ( REGION ). build ( );
37
+ System . out . println ( "Listing Lambda function ..." );
35
38
36
39
GetFunctionConfigurationRequest configRequest = GetFunctionConfigurationRequest .builder ()
37
40
.functionName (functionName ).build ();
@@ -71,5 +74,6 @@ public static void main(String[] args) throws IOException {
71
74
"such as not being able to access the network." );
72
75
System .out .println ("Error Message: " + se .getMessage ());
73
76
}
77
+ awsLambda .close ();
74
78
}
75
79
}
You can’t perform that action at this time.
0 commit comments