本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
堆疊資料包 (aws_opsworks_stack)
重要
AWS OpsWorks Stacks 服務已於 2024 年 5 月 26 日終止,並已針對新客戶和現有客戶停用。我們強烈建議客戶盡快將其工作負載遷移至其他解決方案。如果您對遷移有任何疑問,請透過 AWS re:Post
代表堆疊的設定。
下列範例示範如何使用 Chef 搜尋將堆疊的名稱和技術指南的來源 URL 寫入 Chef 日誌:
stack = search("aws_opsworks_stack").first
Chef::Log.info("********** The stack's name is '#{stack['name']}' **********")
Chef::Log.info("********** The stack's cookbook URL is '#{stack['custom_cookbooks_source']['url']}' **********")
- arn
-
堆疊的 Amazon Resource Name (ARN) (字串)。
- custom_cookbooks_source
-
一組內容,指定自訂技術指南的來源儲存庫。
- type
-
儲存庫類型 (字串)。有效值包含:
-
"archive"
-
"git"
-
"s3"
-
- url
-
儲存庫 URL,例如
"git://github.com/amazonwebservices/opsworks-demo-php-simple-app.git"
(字串)。 - 使用者名稱
-
私有儲存庫為使用者名稱,公有儲存庫則為
null
(字串)。對於私有 Amazon Simple Storage Service (Amazon S3) 儲存貯體,內容會設定為存取金鑰。 - 密碼
-
私有儲存庫為密碼,公有儲存庫則為
null
(字串)。若為私有 S3 儲存貯體,則此內容會設為私有金鑰。 - ssh_key
-
用來存取私有 Git 儲存庫的部署 SSH 金鑰,公有儲存庫則為
null
(字串)。 - 修訂版
-
如果儲存庫有多個分支,此內容會指定該應用程式的分支或版本,例如
"version1"
(字串)。否則會設為null
。
- name
-
堆疊名稱 (字串)。
- region
-
堆疊的 AWS 區域名稱 (字串)。
- stack_id
-
識別堆疊的 GUID (字串)。
- use_custom_cookbooks
-
是否啟用自訂技術指南 (布林值)。
- vpc_id
-
若堆疊正在 VPC 中執行,則為 VPC ID (若堆疊正在 VPC 中執行) (字串)。