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公式更新しました 1年前
- AWS公式更新しました 1年前
- AWS公式更新しました 2年前
- AWS公式更新しました 1年前