本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
在 中定義 an AWS HookDefinitionbash
。
語法
tosca.nodes.AWS.HookDefinition.Bash:
properties:
implementation: String
environment_variables: List
execution_role: String
屬性
-
implementation
-
勾點定義的相對路徑。格式必須為:
./hooks/
script_name
.sh必要:是
類型:字串
-
environment_variables
-
hook bash 指令碼的環境變數。使用下列格式:
搭配下列 regex:envName
=envValue
^[a-zA-Z0-9]+[a-zA-Z0-9\-\_]*[a-zA-Z0-9]+=[a-zA-Z0-9]+[a-zA-Z0-9\-\_]*[a-zA-Z0-9]+$
確保
值符合下列條件:envName
=envValue
-
請勿使用空格。
-
從字母
envName
(A-Z 或 a-z) 或數字 (0-9) 開始。 -
請勿使用下列 AWS TNB 預留關鍵字 (不區分大小寫) 啟動環境變數名稱:
-
CODEBUILD
-
TNB
-
首頁
-
AWS
-
-
您可以使用任意數量的字母 (A-Z 或 a-z)、數字 (0-9) 和特殊字元,
envName
以及_
-
和envValue
。
範例:
A123-45xYz=Example_789
必要:否
類型:清單
-
-
execution_role
-
勾點執行的角色。
必要:是
類型:字串
範例
SampleHookScript:
type: tosca.nodes.AWS.HookDefinition.Bash
properties:
implementation: "./hooks/myhook.sh
"
environment_variables:
- "variable01=value01"
- "variable02=value02"
execution_role: "arn:aws:iam::${AWS::TNB::AccountId}:role/SampleHookPermission
"