-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate-ec2.yml
More file actions
31 lines (31 loc) · 1.02 KB
/
create-ec2.yml
File metadata and controls
31 lines (31 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
---
- hosts: localhost # put localhost. We are processing against aws
connection: local # put local. We are processing against aws
gather_facts: False # don't gather facts against localhost
vars:
instance_name: 'ec2-instance'
key_name: 'oregon'
instance_type: 't2.micro' # keep it free
image: 'ami-0d6621c01e8c2de2c' # free ami from Amazon us-east-1 region
vpc_subnet_id: 'subnet-12180559'
group_id: 'sg-05b887bdb1fdb57fe'
zone: 'us-west-2a'
region: 'us-west-2'
tasks:
- name: create an aws instance
ec2:
key_name: "{{ key_name }}"
instance_type: "{{ instance_type }}"
image: "{{ image }}"
wait: true
count: 1
instance_tags:
Name: "{{ instance_name }}"
BuildStatus: 'Provisioning'
monitoring: no
vpc_subnet_id: "{{ vpc_subnet_id }}"
group_id: "{{ group_id }}"
zone: "{{ zone }}"
region: "{{ region }}"
assign_public_ip: yes
register: ec2_instance