-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation request - valid userdata
examples
#6
Comments
Hey @agile-jtdressel, thanks for opening an issue to bring these documentation gaps to our attention. I agree that the documentation and examples provided for the We'll look into making these changes and will keep this ticket updated along the way. |
@mattcataws While you're working on the formal docs, can you provide here a simple Hello World example, to get us started? @agile-jtdressel is right on target - the lengthy lifecycle of these instances make random experimenting impossible. As a trivial example - how can I do this with userdata and ec2-macos-init?
When I include that in the User Data on a Mac EC2 instance, I get no apparent results other than history.json showing that the '4_RunPerBoot' was successful. When I
which is useless. A simple example would be so helpful! |
Hey @staranto, thanks for following up on this issue. We're still working on updating our docs so I'll leave another comment when I have more news to share. That example userdata you posted should work. Here's what it looked like on the instances I tested:
File generated on disk by
The log message that you saw comes up when the UserData module get's an "exec format error" while trying to execute the The path is - |
Hi - are there any resources for this? I do not know how to use userdata with Mac EC2s |
Hey @bpmct, the Userdata section of the README outlines how userdata is handled in EC2 Mac instances. You can put a shell script in the userdata and Currently, the only resources available are the README and what's posted in this issue. We will be improving the resources provided to better outline how userdata can be used on EC2 macOS instances. |
I have a similar problem as #6 (comment) I get the message:
Unfortunately there’s no file named I am planning to work around this issue by defining a new Command: https://github.com/aws/ec2-macos-init/blob/master/README.md#command |
Hey @henryprecheur, I'm sorry to hear that you're also experiencing issues with userdata. Could you please open a separate issue for this problem you're seeing. I'd like to keep this issue focused on the documentation request but I also want to investigate this problem. In that new issue, could you include the userdata you're trying to execute. I'd also be interested to see what your work around Command looks like as well as the logs from when the command runs. |
The use data I’m trying to execute is something like:
It doesn’t matter how simple the script is: it never gets executed because the userdata file never gets created. This isn’t a documentation issue: the user data execution feature is clearly broken, at least on the Big Sur image I tried and many other before. Reading this ticket: it is clear to me that most users know how to use the feature, it just doesn't work. |
Hello @henryprecheur, Unfortunately, I couldn't reproduce your issue with the given script.
I'll leave some notes from my repro attempt. I used the given script below.
I launched an instance with the following command line with the latest Big Sur AMI named
The launched instance had an attribute of an instance attribute of user-data of the given contents.
After logging into the launched instance, I could see the following command results.
The
The user-data contents are stored under
|
I can confirm, I'm experiencing this same issue. I was directed to use ec2-macos-init by AWS support engineers. I see the same behavior as above, no userdata file is created and an error similar to This is how I'm creating the instance within terraform:
AMI-ID: ami-029fbc1dc4f1f2192
I can also confirm that the output of I believe this may be related to the changing of the password. Unfortunately due to MacOS being as terrible as it is, a random password isn't really feasible. Changing it after first-run also isn't, due to the hour+ it takes to reboot these instances and have the change take effect on e.g., keychains. |
Hello @mschultz-aofl, Could you check what you would see under
My understanding is that the expected contents are the following.
On the other hand,
|
As someone deploying default macOS AMIs, I'd like to see what sort of
userdata
I can provide via the AWS Web Console.The Userdata Example shows how to include a
Execute-User-Data
module in myinit.toml
. I think this example would be useful if I were editinginit.toml
with the intent to make a reusable AMI.I would like to configure some automatic tasks without creating a new AMI. I would not be changing
init.toml
, and would instead only vary theuserdata
. Examples would be helpful because the dedicated hosts have a 24 hour minimum (so I don't want to spin up multiple hosts to experiment) and since they take a while to wipe between runs.My ideal solution would include:
#cloud-config
or an example showing how you can add. (I don't think the examples from https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html work withec2-macos-init
)+x
flag, and thenec2-macos-init
basically just invokes/path/to/userdata
)The text was updated successfully, but these errors were encountered: