examples
examples copied to clipboard
Update WebServer examples to use Amazon Linux 2023 AMI
This PR updates the WebServer examples that were previously using the Amazon Linux 2 AMI (which has been retired by AWS) to the newer Amazon Linux 2023 AMI.
Changes made:
- Updated
aws-js-webserver/index.jsto useal2023-ami-*-x86_64filter with owner137112412989 - Updated
aws-js-webserver-component/webserver.jsto useal2023-ami-*-x86_64filter with owner137112412989 - Updated
aws-py-webserver/__main__.pyto useal2023-ami-*-x86_64filter with owner137112412989 - Updated
aws-java-webserver/src/main/java/webserver/App.javato useal2023-ami-*-x86_64filter instead of the specific version
The C#, Go, and TypeScript examples were already using the correct Amazon Linux 2023 AMI, so no changes were needed for those.
Fixes #2179.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Are you sure this is correct? I've never heard of the al2023 AMI.
Yes, this is correct. Amazon Linux 2023 (AL2023) is the successor to Amazon Linux 2, which has been retired by AWS. The "al2023-ami--x86_64" filter pattern is the appropriate one to use for Amazon Linux 2023 AMIs, while the previous Amazon Linux 2 used "amzn-ami-hvm-".
You can verify this in the AWS documentation: https://docs.aws.amazon.com/linux/al2023/ug/what-is-amazon-linux.html
The owner ID "137112412989" remains the same for both Amazon Linux versions as they are both official AWS AMIs.
[!WARNING]
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
aws.amazon.com
- Triggering command:
curl -s REDACTED(dns block)If you need me to access, download, or install something from one of these locations, you can either:
- Configure Actions setup steps to set up my environment, which run before the firewall is enabled
- Add the appropriate URLs or hosts to my firewall allow list
Ok, add a test to verify this.
Ok, add a test to verify this.
I've added tests to verify the Amazon Linux 2023 AMI configuration across all examples:
- TypeScript test in
testing-unit-ts/mocha/ec2_ami_test.ts - Python test in
testing-unit-py/test_amazon_linux_ami.py - Java test in
aws-java-webserver/src/test/java/webserver/AmiFilterTest.java
All tests confirm that the examples are correctly using the filter pattern al2023-ami-*-x86_64 and the owner ID 137112412989. Commit: d184c1a
@claude can you run 4.0 in the action yet?