Skip to content

Commit 255195a

Browse files
committed
updated POM to use JDK 21
1 parent f285380 commit 255195a

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

javav2/example_code/ec2/src/main/java/com/example/ec2/CreateLaunchTemplate.java

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
package com.example.ec2;
25

36
import software.amazon.awssdk.regions.Region;
@@ -11,19 +14,34 @@
1114
public class CreateLaunchTemplate {
1215

1316
public static void main(String[] args) {
14-
String groupName = "ScottASG606" ; //rgs[0];
15-
String launchTemplateName = "MyTemplate5" ;//args[1];
16-
String vpcZoneId = "subnet-0ddc451b8a8a1aa44" ; //args[2];
17-
String instanceType= "t2.2xlarge" ;
18-
String imageId = "ami-0f6832b69407e9746" ;
19-
String keyName = "TestKeyPair";
17+
final String usage = """
18+
Usage:
19+
<launchTemplateName> <instanceType> <imageId> <keyName>
20+
21+
Where:
22+
launchTemplateName - The name of the launch template to create.
23+
instanceType - The EC2 instance type (e.g., t2.2xlarge).
24+
imageId - The AMI ID for the instance (e.g., ami-0f6832b69407e9746).
25+
keyName - The name of the key pair for SSH access.
26+
""";
27+
28+
if (args.length != 4) {
29+
System.out.println(usage);
30+
System.exit(1);
31+
}
32+
33+
String launchTemplateName = args[0];
34+
String instanceType = args[1];
35+
String imageId = args[2];
36+
String keyName = args[3];
2037

2138
Ec2Client ec2 = Ec2Client.builder()
2239
.region(Region.US_EAST_1)
2340
.build();
2441

2542
createLaunchTemplate(ec2, launchTemplateName, instanceType, imageId, keyName);
2643
}
44+
2745
public static void createLaunchTemplate(Ec2Client ec2, String launchTemplateName, String instanceType, String imageId, String keyName) {
2846
try {
2947
RequestLaunchTemplateData launchTemplateData = RequestLaunchTemplateData.builder()

javav2/example_code/ecs/src/test/java/EcsTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import org.junit.jupiter.api.*;
77
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
88
import static org.junit.jupiter.api.Assertions.assertFalse;
9-
import software.amazon.awssdk.auth.credentials.EnvironmentVariableCredentialsProvider;
109
import software.amazon.awssdk.regions.Region;
1110
import software.amazon.awssdk.services.ecs.EcsClient;
1211
import software.amazon.awssdk.services.secretsmanager.SecretsManagerClient;

javav2/example_code/firehose/src/test/java/FirehoseTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,4 @@ public String getTextValue() {
136136
return textValue;
137137
}
138138
}
139-
140139
}

0 commit comments

Comments
 (0)