本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
在 Image Builder 生器中為自訂YAML元件建立元件文件
若要建立元件,您必須提供YAML或JSON應用程式元件文件。此文件包含在階段期間執行的程式碼,以及您為影像提供自訂而定義的步驟。
本節中的範例會建立呼叫UpdateOS
動作模組的建置元件 AWS TOE 組件管理應用程序。該模塊更新操作系統。如需UpdateOS
動作模組的詳細資訊,請參閱更新。如需有關的階段、步驟和語法的詳細資訊 AWS TOE 應用程式元件文件,請參閱在 AWS TOE.
若要為範例YAML應用程式建立應用程式元件文件,請依照與映像作業系統相符的索引標籤上的步驟執行。
- Linux
-
建立YAML元件檔案
使用檔案編輯工具來建立您的零組件文件。文件範例使用名為的檔案update-linux-os.yaml
,內容如下:
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify,
# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
name: update-linux-os
description: Updates Linux with the latest security updates.
schemaVersion: 1
phases:
- name: build
steps:
- name: UpdateOS
action: UpdateOS
# Document End
使用類似此在線YAML驗證器的工具或代碼環境中的 YAML lint 擴展來驗證您的格式YAML正確。
- Windows
-
建立YAML元件檔案
使用檔案編輯工具來建立您的零組件文件。文件範例使用名為的檔案update-windows-os.yaml
,內容如下:
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify,
# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
name: update-windows-os
description: Updates Windows with the latest security updates.
schemaVersion: 1.0
phases:
- name: build
steps:
- name: UpdateOS
action: UpdateOS
# Document End
使用類似此在線YAML驗證器的工具或代碼環境中的 YAML lint 擴展來驗證您的格式YAML正確。