forked from yankurniawan/ansible-for-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsg_database.yml
30 lines (30 loc) · 876 Bytes
/
sg_database.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
---
- hosts: localhost
connection: local
gather_facts: no
vars:
#your region
region: ap-southeast-2
#your ip address
allowed_ip: 123.243.16.53/32
tasks:
- name: create database security group
local_action:
module: ec2_group
region: "{{ region }}"
name: sg_database_apsydney
description: security group for apsydney database host
rules:
# allow ssh access from your ip address
- proto: tcp
from_port: 22
to_port: 22
cidr_ip: "{{ allowed_ip }}"
# allow mysql access from webserver group
- proto: tcp
from_port: 3306
to_port: 3306
group_name: sg_webserver_apsydney
rules_egress:
- proto: all
cidr_ip: 0.0.0.0/0