# EC2 classic + ELB

**URL:** <https://forum.ansible.com/t/ec2-classic-elb/18020>\
**Category:** Ansible Project\
**Created:** [April 20, 2015, 1:17pm UTC](https://forum.ansible.com/t/ec2-classic-elb/18020 "2015-04-20T13:17:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nico\_K](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@Nico\_K](https://forum.ansible.com/u/Nico_K)\
**Post date:** [April 20, 2015, 1:17pm UTC](https://forum.ansible.com/t/ec2-classic-elb/18020/1 "2015-04-20T13:17:25Z")

</div>

Hi,

In EC2 classic one cannot define Security Groups on the ELB, instead a default value of ‘amazon-elb/amazon-elb-sg’ with id ‘sg-35b1b441’ is used.  
If you try to modify a security group that refers to this pre-defined security group ansible will throw a KeyError for the id.

For example, manually create a security group ‘test’, and add ‘amazon-elb/amazon-elb-sg’ to it.  
Now attempt to run Ansible to (re-)create the security group ‘test’, it will fail with:

BECOME-SUCCESS--------------------------------  
Traceback (most recent call last):  
File “/path/omitted/ec2\_group”, line 2187, in   
main()  
File “/path/omitted/ec2\_group”, line 310, in main  
grantGroup = groups[grant.group\_id]  
KeyError: u’sg-35b1b441’

Thanks,  
Nico
