简体   繁体   中英

How to instantiate an AWS Linux using python API?

1) Instantiate an AWS Linux, micro instance using the AWS python API (include authentication to AWS)

2) Update the instance with tags: customer=ACME, environment=PROD

3) Assign a security group to the instance

To program in Python on AWS, you should use the boto3 library.

You will need to do the following:

  1. supply credentials to the library ( link )
  2. create an EC2 client ( link )
  3. use the EC2 client to launch EC2 instances using run_instances ( link )

You can specify both tags and security groups in the run_instances call. Additionally, the boto3 documentation provides some Amazon EC2 examples that will help.

Maybe you want to observe this project:

https://github.com/nchammas/flintrock

This is a hadoop and apache spark clustering project. But, it can inspire you. Actually, there is many feature that you want like security group or filtering by tag name. Just, look around of code

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM