AWS - Provisioning EC2 instance using ansible
Below is my EC2 module to create instances in AWS using Ansible
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- # EC2 MODULE PROVISIONING | |
- hosts: localhost | |
connection: local | |
remote_user: test | |
become: yes | |
gather_facts: no | |
vars_files: | |
- files/awscreds.yml | |
tasks: | |
- name: Basic Provisioning of two m3.medium EC2 instance | |
ec2: | |
aws_access_key: "{{ aws_id }}" | |
aws_secret_key: "{{ aws_key }}" | |
region: "{{ aws_region }}" | |
image: ami-f0091d91 | |
instance_type: m3.medium | |
count: 2 |
Note: Research purpose.