View a markdown version of this page

列出並檢視映像配方詳細資訊 - EC2 Image Builder

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

列出並檢視映像配方詳細資訊

本節說明您可以尋找資訊和檢視 EC2 Image Builder 映像配方詳細資訊的各種方式。

從主控台列出映像配方

若要在映像建置器主控台中查看在您帳戶下建立的映像配方清單,請依照下列步驟執行:

  1. 開啟 EC2 Image Builder 主控台,位於 https://console.aws.amazon.com/imagebuilder/

  2. 從導覽窗格中選擇映像配方。這會顯示在您帳戶下建立的映像配方清單。

  3. 若要檢視詳細資訊或建立新的配方版本,請選擇配方名稱連結。這會開啟配方的詳細資訊檢視。

    注意

    您也可以選取配方名稱旁的核取方塊,然後選擇檢視詳細資訊

從 列出映像配方 AWS CLI

下列範例示範如何使用 列出所有映像配方 AWS CLI。

aws imagebuilder list-image-recipes

命令會傳回每個映像配方的摘要,如下列範例輸出所示。

{ "requestId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "imageRecipeSummaryList": [ { "arn": "arn:aws:imagebuilder:us-west-2:123456789012:image-recipe/my-recipe/1.0.0", "name": "my-recipe", "platform": "Linux", "owner": "123456789012", "parentImage": "arn:aws:imagebuilder:us-west-2:aws:image/amazon-linux-2023-x86/x.x.x", "dateCreated": "2024-01-15T10:30:00.000Z", "tags": { "Environment": "Production" } } ] }

您可以依擁有者篩選結果,以控制命令傳回的配方。

aws imagebuilder list-image-recipes --owner Self

使用 Self列出您擁有的配方,或Shared列出其他帳戶與您共用的配方。

aws imagebuilder list-image-recipes --owner Shared

若要限制命令在每個頁面上傳回的結果數量,請使用 --max-results 參數。如果有更多結果可用,回應會包含nextToken您傳遞給下一個命令的值,以擷取下頁。

aws imagebuilder list-image-recipes --max-results 10 --next-token "eyJuZXh0VG9rZW4..."

從主控台檢視映像配方詳細資訊

若要使用映像建置器主控台檢視特定映像配方的詳細資訊,請使用中所述的步驟選取要檢閱的映像配方從主控台列出映像配方

在配方詳細資訊頁面上,您可以:

從 取得映像配方詳細資訊 AWS CLI

下列範例示範如何使用 imagebuilder CLI 命令,透過指定映像配方的 Amazon Resource Name (ARN) 來取得映像配方的詳細資訊。

aws imagebuilder get-image-recipe --image-recipe-arn arn:aws:imagebuilder:us-west-2:123456789012:image-recipe/my-recipe/1.0.0

命令會傳回完整的映像配方,如下列範例輸出所示。

{ "requestId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "imageRecipe": { "arn": "arn:aws:imagebuilder:us-west-2:123456789012:image-recipe/my-recipe/1.0.0", "name": "my-recipe", "description": "My Linux image recipe", "platform": "Linux", "version": "1.0.0", "components": [ { "componentArn": "arn:aws:imagebuilder:us-west-2:123456789012:component/my-component/1.0.0/1" } ], "parentImage": "arn:aws:imagebuilder:us-west-2:aws:image/amazon-linux-2023-x86/x.x.x", "dateCreated": "2024-01-15T10:30:00.000Z", "tags": {}, "owner": "123456789012" } }

從 取得映像配方政策詳細資訊 AWS CLI

配方政策是以資源為基礎的政策。它控制對配方的跨帳戶存取。當您透過 AWS Resource Access Manager (AWS RAM) 共用配方時,Image Builder 會自動建立政策。您也可以使用 put-image-recipe-policy命令設定自訂政策。

注意

如果您直接使用 設定資源政策put-image-recipe-policy,則必須將資源提升為 AWS RAM 資源共用,以便與您共用資源的主體可以看見該資源政策。如需詳細資訊,請參閱選項 2:套用資源政策並提升為現有的資源共享

下列範例示範如何使用 imagebuilder CLI 命令,透過指定其 ARN 來取得映像配方政策的詳細資訊。如果沒有政策連接到配方,則回應為空白。

aws imagebuilder get-image-recipe-policy --image-recipe-arn arn:aws:imagebuilder:us-west-2:123456789012:image-recipe/my-recipe/1.0.0