Skip to content

Commit 31b2dc9

Browse files
Copilotjoeduffy
andcommitted
Update JavaScript, Python, and Java WebServer examples to use Amazon Linux 2023 AMI
Co-authored-by: joeduffy <[email protected]>
1 parent 6e5dff8 commit 31b2dc9

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

aws-java-webserver/src/main/java/webserver/App.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static void stack(Context ctx) {
2525
final var ami = Ec2Functions.getAmi(GetAmiArgs.builder()
2626
.filters(GetAmiFilterArgs.builder()
2727
.name("name")
28-
.values("amzn2-ami-hvm-2.0.20231218.0-x86_64-ebs")
28+
.values("al2023-ami-*-x86_64")
2929
.build())
3030
.owners("137112412989")
3131
.mostRecent(true)

aws-js-webserver-component/webserver.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
const pulumi = require("@pulumi/pulumi");
44
const aws = require("@pulumi/aws");
55

6-
// Get the id for the latest Amazon Linux AMI
6+
// Get the id for the latest Amazon Linux 2023 AMI
77
let ami = aws.ec2.getAmi({
88
filters: [
9-
{ name: "name", values: ["amzn2-ami-hvm-*"] },
9+
{ name: "name", values: ["al2023-ami-*-x86_64"] },
1010
],
11-
owners: ["amazon"],
11+
owners: ["137112412989"],
1212
mostRecent: true,
1313
}, { async: true }).then(result => result.id);
1414

aws-js-webserver/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ const aws = require("@pulumi/aws");
55

66
let size = "t2.micro"; // t2.micro is available in the AWS free tier
77

8-
// Get the id for the latest Amazon Linux AMI
8+
// Get the id for the latest Amazon Linux 2023 AMI
99
let ami = aws.ec2.getAmi({
1010
filters: [
11-
{ name: "name", values: ["amzn2-ami-hvm-*"] },
11+
{ name: "name", values: ["al2023-ami-*-x86_64"] },
1212
],
13-
owners: ["amazon"],
13+
owners: ["137112412989"],
1414
mostRecent: true,
1515
}, { async: true }).then(result => result.id);
1616

aws-py-webserver/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
ami = aws.ec2.get_ami(
99
most_recent=True,
10-
owners=["amazon"],
11-
filters=[{"name": "name", "values": ["amzn2-ami-hvm-*"]}],
10+
owners=["137112412989"],
11+
filters=[{"name": "name", "values": ["al2023-ami-*-x86_64"]}],
1212
)
1313

1414
group = aws.ec2.SecurityGroup(

0 commit comments

Comments
 (0)