本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
有數種方法能讓您尋找可購買的 AMI。例如,您可以使用 AWS Marketplace
使用主控台尋找已支付 AMI
-
在 https://console.aws.amazon.com/ec2/
開啟 Amazon EC2 主控台。 -
在導覽窗格中,選擇 AMIs (AMI)。
-
中,選擇 Public images (公有映像) 作為第一個篩選條件。
-
在搜尋列中,依序選擇 Owner alias (擁有者別名)、= 和 aws-marketplace。
-
如果您知道產品代碼,請選擇 Product code (產品代碼) 和 =,然後輸入產品代碼。
使用 尋找付費 AMI AWS Marketplace
打開 AWS Marketplace
. 在搜尋欄位中輸入作業系統的名稱,然後選擇搜尋按鈕 (放大鏡)。
若要進一步限制搜尋結果的範圍,請使用其中一種分類或篩選條件。
每一種產品都帶有其產品類型的標籤:
AMI
或Software as a Service
您可以使用下列 describe-images
aws ec2 describe-images --owners aws-marketplace
此命令會傳回描述每一個 AMI 的數種詳細資訊,包含已支付 AMI 的產品代碼。describe-images
的輸出包含產品代碼的項目,如下所示:
"ProductCodes": [
{
"ProductCodeId": "product_code
",
"ProductCodeType": "marketplace"
}
],
如果您知道產品代碼,您可以依產品代碼篩選結果。此範例會傳回最新 AMI 與指定的產品代碼。
aws ec2 describe-images --owners aws-marketplace \ --filters "Name=product-code,Values=
product_code
" \ --query "sort_by(Images, &CreationDate)[-1].[ImageId]"
您可以使用下列 Get-EC2Image 命令尋找已支付 AMI。
PS C:\>
Get-EC2Image -Owner aws-marketplace
已支付 AMI 的輸出包含產品代碼。
ProductCodeId ProductCodeType
------------- ---------------
product_code
marketplace
如果您知道產品代碼,您可以依產品代碼篩選結果。此範例會傳回最新 AMI 與指定的產品代碼。
PS C:\>
(Get-EC2Image -Owner aws-marketplace -Filter @{"Name"="product-code";"Value"="
product_code
"} | sort CreationDate -Descending | Select-Object -First 1).ImageId