How to create slave jenkins given master jenkins?
You could use the EC2 plugin or the ECS plugin if you want to provision agents dynamically. These would provide some environment variables to use when constructing build_id - e.g. :


BUILD_TAG: 


  String of "jenkins-${JOB_NAME}-${BUILD_NUMBER}". All forward slashes ("/") in the JOB_NAME are replaced with dashes ("-"). Convenient to put into a resource file, a jar file, etc for easier identification.

NODE_NAME:


  Name of the agent if the build is on an agent, or "master" if run on master



You would have to configure the clouds in Jenkins, assign a label to the templates you want to use as agents, and then request those in your pipeline or job configuration.