From 821ea9af67da529f95a89e16d2f840318fa0d16f Mon Sep 17 00:00:00 2001 From: Scottpedia Date: Fri, 21 Jul 2023 17:02:18 +0800 Subject: [PATCH] fix CentOS 7 AMI sorting constrain `centos` is only username for CentOS Linux 7 Reference: https://centos.org/download/aws-images/ --- aws/README.md | 2 +- aws/cloudformation-template-ipsec.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/README.md b/aws/README.md index d8c7ce0..024e83c 100644 --- a/aws/README.md +++ b/aws/README.md @@ -55,7 +55,7 @@ List of default usernames: | --- | --- | | Ubuntu | `ubuntu` | | Debian | `admin` | -| CentOS | `centos` | +| CentOS (`CentOS Linux 7`) | `centos` | | Amazon Linux 2 | `ec2-user` | This template generates a key pair for you during deployment, and the private key will be available as text under the **Outputs** tab after the stack is successfully created. diff --git a/aws/cloudformation-template-ipsec.json b/aws/cloudformation-template-ipsec.json index 28eef4b..613b405 100644 --- a/aws/cloudformation-template-ipsec.json +++ b/aws/cloudformation-template-ipsec.json @@ -374,7 +374,7 @@ " 'Debian10': 'debian-10-amd64-*',", " 'Debian11': 'debian-11-amd64-*',", " 'Debian12': 'debian-12-amd64-*',", - " 'CentOS7': 'CentOS 7.9.2009 x86_64',", + " 'CentOS7': 'CentOS Linux 7 x86_64 - *',", " 'AmazonLinux2': 'amzn2-ami-hvm-*.*-x86_64-gp2',", " }[distribution]", " response = ec2.describe_images(Filters=[{'Name':'name', 'Values':[AMIName]}], Owners=['099720109477', '136693071363', '125523088429', 'amazon'])",