Thanks for the question! You can pass user data to an AWS Elastic Beanstalk instance launched with a custom AMI in a few different ways.
One way is to use the AWS Elastic Beanstalk console. On the Environment Details page, click the Edit button next to the User data setting. You can then enter your user data in the text box that appears.
Another way is to use the AWS Elastic Beanstalk CLI. You can use the eb config command to set the UserData property in the environment's configuration file (.ebextensions). For example, the following command sets the UserData property to a Base64-encoded string:
eb config -e my-env --setting UserData="IyEvYmluL2Jhc2gKZWNobyAnSGVsbG8gZnJvbSBXb3JsZCEnID4+IC9lbmdpbmUvdGVtcC90ZXN0LnR4dAo="
You can also set the UserData property in the environment's configuration file (.ebextensions) directly. For example:
- namespace: aws:autoscaling:launchconfiguration
For more information, see the following documentation:
Configuring Instances by Using User Data - http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#customize-containers-format-user-data
eb config - http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-cmd-reference.html#eb3-config