Amazon ec2 Terraform模板\u cloudinit\u配置多部件执行顺序错误
我使用terraform构建ec2实例作为实例引导的一部分,添加了cloud init config以运行多个userdata脚本。但是content_type=“text/x-shellscript”总是先执行。我验证了cat/var/log/cloud-init-output.log文件。它显示首先调用shell脚本。如何配置shell脚本以最终运行Amazon ec2 Terraform模板\u cloudinit\u配置多部件执行顺序错误,amazon-ec2,terraform,cloud-init,Amazon Ec2,Terraform,Cloud Init,我使用terraform构建ec2实例作为实例引导的一部分,添加了cloud init config以运行多个userdata脚本。但是content_type=“text/x-shellscript”总是先执行。我验证了cat/var/log/cloud-init-output.log文件。它显示首先调用shell脚本。如何配置shell脚本以最终运行 data "template_cloudinit_config" "myapp_cloudinit_config
data "template_cloudinit_config" "myapp_cloudinit_config" {
gzip = false
base64_encode = false
# Main cloud-config configuration file.
part {
content_type = "text/cloud-config"
content = "${data.template_file.base_bootstrap_file.rendered}"
merge_type = "list(append)+dict(recurse_array)+str()"
}
part {
content_type = "text/cloud-config"
content = "${module.template_file_appsec_init.appsec_user_data_rendered}"
merge_type = "list(append)+dict(recurse_array)+str()"
}
part {
content_type = "text/x-shellscript"
content = "${module.template_file_beat_init.beat_user_data_rendered}"
}
}
Shell脚本如下所示
module " template_file_beat_init" {
source = "url" #the source url contains the zip file which includes the below shell script
}
云提供商:AWS
操作系统:RHEL 8.3
cloud init--版本:/usr/bin/cloud init 19.4
Terraform v0.11.8您解决了这个问题吗?您解决了这个问题吗?
#!/bin/sh
deploy_the_app() {
//invoke ansible playbook execution
}
deploy_the_app