Skip to content
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

[aws][ami]Amazon Linux 1 AMI No Longer Available #1386

Closed
2 tasks
ryehowell opened this issue Jan 16, 2024 · 0 comments · Fixed by #1387
Closed
2 tasks

[aws][ami]Amazon Linux 1 AMI No Longer Available #1386

ryehowell opened this issue Jan 16, 2024 · 0 comments · Fixed by #1387
Assignees
Labels
bug Something isn't working

Comments

@ryehowell
Copy link
Contributor

Describe the bug
Amazon Linux 1 ended support on 12/31/2023 and it looks like the AMI is no longer available for use. Functions that query for the Amazon Linux AMI's are returning empty lists now due to the hardcoded name "*amzn-, such as:

func GetAmazonLinuxAmiE(t testing.TestingT, region string) (string, error) {
	filters := map[string][]string{
		"name":                             {"*amzn-ami-hvm-*-x86_64*"},
		"virtualization-type":              {"hvm"},
		"architecture":                     {"x86_64"},
		"root-device-type":                 {"ebs"},
		"block-device-mapping.volume-type": {"gp2"},
	}

	return GetMostRecentAmiIdE(t, region, AmazonAccountId, filters)
}

The name needs to be updated to Amazon Linux 2 to continue to work.

Example: amzn2-ami-hvm-*-x86_64*

To Reproduce
Query the AWS API:

# This returns empty list
 aws ec2 describe-images --owners amazon --filters "Name=root-device-type,Values=ebs" "Name=architecture,Values=x86_64" "Name=block-device-mapping.volume-type,Values=gp2" "Name=virtualization-type,Values=hvm" "Name=name,Values=*amzn-ami-hvm-*-x86_64*"

# This returns list of available AMI ID's
 aws ec2 describe-images --owners amazon --filters "Name=root-device-type,Values=ebs" "Name=architecture,Values=x86_64" "Name=block-device-mapping.volume-type,Values=gp2" "Name=virtualization-type,Values=hvm" "Name=name,Values=*amzn2-ami-hvm-*-x86_64*"

Expected behavior
Update the aws ami module to use Amazon Linux 2 AMI's

Nice to have

  • Terminal output
  • Screenshots

Versions

  • Terratest version:
  • Environment details (Ubuntu 20.04, Windows 10, etc.):

Additional context
Add any other context about the problem here.

@ryehowell ryehowell added the bug Something isn't working label Jan 16, 2024
@denis256 denis256 self-assigned this Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants