AWS EC2 Instance from YAML file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • terrysc04
    New Member
    • Dec 2021
    • 1

    #1

    AWS EC2 Instance from YAML file

    I am trying to understanding a coding challenge. I need to create a YAML file to automate deployment of an ec2 instance. Here is the specifications of the YAML file:

    # This YAML configuration specifies a server with two volumes and two users
    server:
    instance_type: t2.micro
    ami_type: amzn2
    architecture: x86_64
    root_device_typ e: ebs
    virtualization_ type: hvm
    min_count: 1
    max_count: 1
    volumes:
    - device: /dev/xvda
    size_gb: 10
    type: xfs
    mount: /
    - device: /dev/xvdf
    size_gb: 20
    type: ext4
    mount: /data
    users:
    - login: user1
    ssh_key: --user1 ssh public key goes here-- user1@localhost
    - login: user2
    ssh_key: --user2 ssh public key goes here-- user2@localhost

    My Python file will read the YAML file but I am unsure of the coding structure of the automation (create user, create volumes). I can use Boto3 for AWS features. Thanks for any help provided.
Working...