Run custom shell script as soon as an EKS or ASG instance is launched in AWS

968 views Asked by At

I would like to perform domain join on any servers provisioned in my AWS environment.

For ASG and EKS, can launch template be used to run custom scripts as soon as new nodes are launched?

1

There are 1 answers

0
Riz On

Yes, with ASG you can run custom scripts. You need to modify your User data in your launch template or launch configuration. You can retrive scripts saved in s3 or pass any commands or script directly. If it's just a join to freeipa for example. You can do it with a simple one line command(don't foget to add #!/bin/bash in the begining of user data) instead of a script. More information can be found here and here.