Closed vpnagraj closed 3 years ago
this is all set now.
the workflow to set up / use the launch template:
start an ec2 instance with desired configurations (AMI, instance type, bootsrap script, storage config, IAM role, etc)
get launch template data from running instance and store as json:
aws ec2 get-launch-template-data \
--instance-id {ID-OF-RUNNING-INSTANCE-HERE} \
--query "LaunchTemplateData" > launch.json
aws ec2 create-launch-template \
--launch-template-name {DESIRED-LAUNCH-TEMPLATE-NAME-HERE} \
--version-description WebVersion1 \
--tag-specifications 'ResourceType=launch-template,Tags=[{Key=purpose,Value=production}]' \
--launch-template-data file://launch.json
stop the original instance
and whenever you want to boot a new instance from launch template:
aws ec2 run-instances --launch-template LaunchTemplateId={ID-OF-LAUNCH-TEMPLATE-DEFINE-ABOVE-HERE}
keeping open, reassigning to me, i want to try this after we submit next week.
right on. keep me posted when you start looking at it. i can walk you through the details (mostly step 1 above). we'll also need to work some IAM magic to make sure the instance you create can read/write to the bucket.
Sure thing. I fully anticipate this will take some iteration. Anything involving IAM takes me some iteration.
@stephenturner im triaging your request to test this over to https://github.com/signaturescience/focustools/issues/42
we can focus the conversation over there.
in addition to the bootstrapping (#23) we can / should define the ec2 instance details (instance type, AMI, availability zone, etc) in code.
an example of how to configure launch template from a previous project:
https://github.com/signaturescience/kube#launch