Skip to content

Update WebServer examples to use Amazon Linux 2023 AMI #2180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Copilot
Copy link

@Copilot Copilot AI commented May 20, 2025

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.js to use al2023-ami-*-x86_64 filter with owner 137112412989
  • Updated aws-js-webserver-component/webserver.js to use al2023-ami-*-x86_64 filter with owner 137112412989
  • Updated aws-py-webserver/__main__.py to use al2023-ami-*-x86_64 filter with owner 137112412989
  • Updated aws-java-webserver/src/main/java/webserver/App.java to use al2023-ami-*-x86_64 filter 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.

@Copilot Copilot AI changed the title [WIP] WebServer examples use an out of date AMI Update WebServer examples to use Amazon Linux 2023 AMI May 20, 2025
@Copilot Copilot AI requested a review from joeduffy May 20, 2025 13:43
Copilot finished work on behalf of joeduffy May 20, 2025 13:43
Copy link
Member

@joeduffy joeduffy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is correct? I've never heard of the al2023 AMI.

Copy link
Author

Copilot AI commented May 20, 2025

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:

Copilot finished work on behalf of joeduffy May 20, 2025 18:20
@joeduffy
Copy link
Member

Ok, add a test to verify this.

Copy link
Author

Copilot AI commented May 20, 2025

Ok, add a test to verify this.

I've added tests to verify the Amazon Linux 2023 AMI configuration across all examples:

  1. TypeScript test in testing-unit-ts/mocha/ec2_ami_test.ts
  2. Python test in testing-unit-py/test_amazon_linux_ami.py
  3. 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

Copilot finished work on behalf of joeduffy May 20, 2025 18:40
@rshade
Copy link
Contributor

rshade commented May 23, 2025

@claude can you run 4.0 in the action yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WebServer examples use an out of date AMI
3 participants