while spinning up the Ec2 mac [mac1.metal/mac2.metal] instances facing the issue.
instance created successfully and user data not executed .
user_data.sh
#!/bin/zsh
echo "PROXY SETUP"
export HTTP_PROXY=http.proxy.aws.abcd.com:8000
echo $HTTP_PROXY
main.tf
resource "aws_instance" "mac_instance" {
ami = local.instance_ami
instance_type = var.instance_type
subnet_id = var.subnet
host_id = aws_ec2_host.mac_host.id
key_name = var.keypair
iam_instance_profile = var.mac_iam_profile
security_groups = [<list of SG's>]
user_data = filebase64("./user_data.sh")
}
File is available on the instance
root# ls -lrt /usr/local/aws/ec2-macos-init/instances/i-xxxx7657668xxxx
-rwxr-xr-x 1 root wheel 635 Jan 17 11:59 userdata
-rw-r–r-- 1 root wheel 1134 Jan 17 11:59 history.json
Error : Error while running module [ExecuteUserData] (type: userdata, group: 5) with message: error while running user data with stdout: and stderr: and err: fork/exec /usr/local/aws/ec2-macos-init/instances/i-xxxx7657668xxxx/userdata: no such file or directory
didn’t get any solution from web. so asking here. please respond ASAP , stuck with this