# SG access different per environment

**URL:** <https://forum.ansible.com/t/sg-access-different-per-environment/20044>\
**Category:** Ansible Project\
**Created:** [December 17, 2015, 8:50pm UTC](https://forum.ansible.com/t/sg-access-different-per-environment/20044 "2015-12-17T20:50:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicolas\_G](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@Nicolas\_G](https://forum.ansible.com/u/Nicolas_G)\
**Post date:** [December 17, 2015, 8:50pm UTC](https://forum.ansible.com/t/sg-access-different-per-environment/20044/1 "2015-12-17T20:50:52Z")

</div>

Hi, I have the bellow security groups that is working :

`  
name: modify sg\_default rules  
local\_action:  
module: ec2\_group  
region: “us-east-1”  
vpc\_id: “{{ vpcid }}”  
name: “test”  
rules:

- proto: all  
cidr\_ip: “{{ office\_ip }}”
- proto: tcp  
from\_port: 22  
to\_port: 22  
cidr\_ip: “0.0.0.0/0”  
`

This will open ssh port to the public and all ports to the office IP . I would like to have the ssh port open to the public only in a dev environment and not always .

Any ideas how can I do that ?
