2개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
0
With some hints from folks on SO, I was able to solve my issue. Posting here for others.
Looks like Amazonlinux:2023 needs the script interpreter shebang which was probably optional for Amazonlinux2. My script had incorrect EOT and an extra space that was effectively rendering a missing shebang. Here's the fixed code:
data "cloudinit_config" "cloudinit" {
gzip = false
base64_encode = false
part {
content_type = "text/x-shellscript"
content = <<-EOT
#!/bin/bash
echo "Running User Data on $HOSTNAME"
EOT
filename = "cloudinit.sh"
}
}
답변함 2달 전
0
I can see that on both amazon linux versions, terraform is attaching the following multipart user data which is identical so clearly nothing different about terraform setup either. I tried some older versions of amazon linux 2023 too but no luck:
Content-Type: multipart/mixed; boundary="MIMEBOUNDARY"
MIME-Version: 1.0
--MIMEBOUNDARY
Content-Disposition: attachment; filename="cloudinit.sh"
Content-Transfer-Encoding: 7bit
Content-Type: text/x-shellscript
Mime-Version: 1.0
# !/bin/bash
echo "Running User Data on $HOSTNAME"
--MIMEBOUNDARY--
답변함 2달 전
관련 콘텐츠
- AWS 공식업데이트됨 2년 전
- AWS 공식업데이트됨 일 년 전
- AWS 공식업데이트됨 3달 전
- AWS 공식업데이트됨 일 년 전