Skip to content

Commit 5441718

Browse files
authored
Fix: Update AMI filter patterns in EC2 webserver examples (#2165)
* Update outdated AMI filters from amzn-ami-hvm-* to al2023-ami-*-x86_64 * This fixes issue #2103 where webserver examples were failing due to outdated AMI filters * Updated TypeScript, Go, C# webserver examples and Ruby on Rails example
1 parent 6f104f7 commit 5441718

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

aws-cs-webserver/WebServerStack.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public WebServerStack()
1212
{
1313
MostRecent = true,
1414
Owners = {"137112412989"},
15-
Filters = {new GetAmiFilterInputArgs {Name = "name", Values = "amzn-ami-hvm-*"}}
15+
Filters = {new GetAmiFilterInputArgs {Name = "name", Values = "al2023-ami-*-x86_64"}}
1616
});
1717

1818
var group = new SecurityGroup("web-secgrp", new SecurityGroupArgs

aws-go-webserver/main.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ func main() {
2222
return err
2323
}
2424

25-
// Get the ID for the latest Amazon Linux AMI.
25+
// Get the ID for the latest Amazon Linux 2023 AMI.
2626
mostRecent := true
2727
ami, err := ec2.LookupAmi(ctx, &ec2.LookupAmiArgs{
2828
Filters: []ec2.GetAmiFilter{
2929
{
3030
Name: "name",
31-
Values: []string{"amzn-ami-hvm-*-x86_64-ebs"},
31+
Values: []string{"al2023-ami-*-x86_64"},
3232
},
3333
},
3434
Owners: []string{"137112412989"},
@@ -54,4 +54,4 @@ nohup python -m SimpleHTTPServer 80 &`),
5454
ctx.Export("publicHostName", srv.PublicDns)
5555
return nil
5656
})
57-
}
57+
}

aws-ts-ruby-on-rails/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const amiId = aws.ec2.getAmi({
1919
filters: [
2020
{
2121
name: "name",
22-
values: ["amzn-ami-hvm-2018.03*"],
22+
values: ["al2023-ami-*-x86_64"],
2323
},
2424
{
2525
name: "virtualization-type",

aws-ts-webserver/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import * as aws from "@pulumi/aws";
44
import * as pulumi from "@pulumi/pulumi";
55

6-
// Get the id for the latest Amazon Linux AMI
6+
// Get the id for the latest Amazon Linux 2023 AMI
77
const ami = aws.ec2.getAmi({
88
filters: [
9-
{ name: "name", values: ["amzn-ami-hvm-*-x86_64-ebs"] },
9+
{ name: "name", values: ["al2023-ami-*-x86_64"] },
1010
],
1111
owners: ["137112412989"], // Amazon
1212
mostRecent: true,

0 commit comments

Comments
 (0)