Creating an AWS EC2 Instance Image Using Salt Stitch?

Has anyone tried creating an AWS AMI (image) using a salt sink.

I tried to use it to create a new instance from existing AMI, but how to create an image using salt clouds?

Also tried to use boto_ec2, but he gave an error that the module "boto_ec2" is not available.

+6
source share
1 answer

You can do this in 2 steps:

  • you need to take a snapshot of your volume
  • you can create AMI from given pictures

You can see all the ecsta salt shell commands at https://docs.saltstack.com/en/latest/ref/clouds/all/salt.cloud.clouds.ec2.html

  • create snapshots: create_snapshot

    salt-cloud -f create_snapshot my-ec2-config volume_id=vol-351d8826 salt-cloud -f create_snapshot my-ec2-config volume_id=vol-351d8826 \ description="My Snapshot Description" 
  • create AMI: register_image

This command creates the s from the snapshot.

 salt-cloud -f register_image my-ec2-config ami_name=my_ami \ description="my description" root_device_name=/dev/xvda snapshot_id=snap-xxxxxxxx 
+1
source

All Articles