"provisioner": {
"file": {
"connection": {
"private_key": "${file(\"/KeyPair.pem\")}",
"user": "id"
},
"content": "${template_file.x1}",
"destination": "/path/to/dest1"
},
"file": {
"connection": {
"private_key": "${file(\"/KeyPair.pem\")}",
"user": "id"
},
"content": "${template_file.x2}",
"destination": "/path/to/dest2"
}
}
私はJSON Terraformスクリプレットを持っています。私はファイルの提供者をマージ/グループ化する必要があることを理解していますが、それを行う方法があまりにもわかりません。JSONの複数ファイルプロビジョナTerraform
妥当性検査中にエラーが発生し続けます。
SyntaxError: Duplicate key 'file' on line 78
インライン機能を使用する必要がありますか?
編集..
私はこれが正しいかもしれないと思いますか?誰かが確認する?
"file": {
"connection": {
"private_key": "${file(\"/KeyPair.pem\")}",
"user": "id"
},
"content": [
"${template_file.1}",
"${template_file.2}"
],
"destination": [
"/path/dest/",
"/path/dest/"
]
}
私はそれを働いたと思いますか?これは正しいです ...? ' "ファイル":{ \t "接続":{ \t \t "PRIVATE_KEY": "$ {ファイル(\"/ KeyPair.pem \ ")}"、 \t \t "ユーザ": "ID" \t} 、 \t "コンテンツ":[ \t \t "$ {template_file.1}"、 \t \t "$ {template_file.2}" \t]、 \t "宛先":[ \t \t「/パス/ DEST /」、 \t \t "/ path/dest /" \t } – lankan