aws ec2 describe-instances
aws ec2 describe-images --owners amazon --filters "Name=name,Values=amzn2-ami-hvm-2.0.????????-x86_64-gp2" --query 'Images[*].[ImageId,CreationDate]' --output text | sort -k2 -r | head -n 1
aws ec2 create-image --instance-id <instance-id> --name "My server" --description "An AMI for my server" --no-reboot
aws ec2 create-security-group --group-name MySecurityGroup --description "My security group"
aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol tcp --port <port-number> --cidr <ip-range>
aws ec2 authorize-security-group-egress --group-id <security-group-id> --protocol tcp --port <port-number> --cidr <ip-range>
aws cloudtrail create-trail --name MyTrail --s3-bucket-name <bucket-name>
aws cloudtrail update-trail --name MyTrail --is-multi-region-trail
aws cloudtrail start-logging --name MyTrail
create_snapshot
method to create a snapshot of the volume.copy_snapshot
method to copy the snapshot and enable encryption during the copy process.create_volume
method to create a new encrypted volume.create_flow_logs
method to enable them.put_configuration_recorder
and put_delivery_channel
methods to enable it.