2 réponses
- Le plus récent
- Le plus de votes
- La plupart des commentaires
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"
}
}
répondu il y a 2 mois
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--
répondu il y a 2 mois
Contenus pertinents
- demandé il y a 2 ans
- demandé il y a un an
- demandé il y a 10 mois
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a 5 mois
- AWS OFFICIELA mis à jour il y a 3 mois