forked from yankurniawan/ansible-for-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsg_jumpbox.yml
31 lines (31 loc) · 854 Bytes
/
sg_jumpbox.yml
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
gather_facts: no
vars_files:
- staging_vpc_info
vars:
#your region
region: ap-southeast-2
#your ip address
allowed_ip: 123.243.16.53/32
#prefix for naming
prefix: staging
vpc_id: "{{ staging_vpc }}"
tasks:
- name: create security group for jump box instance
local_action:
module: ec2_group
region: "{{ region }}"
vpc_id: "{{ vpc_id }}"
#your security group name
name: "{{ prefix }}_sg_jumpbox"
description: security group for jump box
rules:
# allow ssh access from your ip address
- proto: tcp
from_port: 22
to_port: 22
cidr_ip: "{{ allowed_ip }}"
rules_egress:
- proto: all
cidr_ip: 0.0.0.0/0