# Created an elasticache via Ansible - Get an Error "Use of cache security groups is not permitted in this API version for your account"

**URL:** <https://forum.ansible.com/t/created-an-elasticache-via-ansible-get-an-error-use-of-cache-security-groups-is-not-permitted-in-this-api-version-for-your-account/15966>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [August 16, 2014, 12:03am UTC](https://forum.ansible.com/t/created-an-elasticache-via-ansible-get-an-error-use-of-cache-security-groups-is-not-permitted-in-this-api-version-for-your-account/15966 "2014-08-16T00:03:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shih\_Oon\_Liong2](https://avatars.discourse-cdn.com/v4/letter/s/90ced4/32.png) [@Shih\_Oon\_Liong2](https://forum.ansible.com/u/Shih_Oon_Liong2)\
**Post date:** [August 16, 2014, 12:03am UTC](https://forum.ansible.com/t/created-an-elasticache-via-ansible-get-an-error-use-of-cache-security-groups-is-not-permitted-in-this-api-version-for-your-account/15966/1 "2014-08-16T00:03:11Z")

</div>

I was trying to provision a new memcached server via ansible

```auto
- name: AWS | Create Redis
      local_action:
        module: elasticache
        region: sa-east-1
        name: "test-please-delete"
        state: present
        engine: memcached
        cache_engine_version: 1.4.14
        node_type: cache.m1.small
        num_nodes: 1
        cache_port: 11211
        cache_security_groups:
           - **default**
        zone: sa-east-1a

```

When I ran it I get the error " Use of cache security groups is not permitted in this API version for your account." This seems to only occur in Sau Paolo Region and every other reason. With the only exception being US East for example works fine.

Any ideas where I can diagnose this - looking for this error on google shows me no lead thus far

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [August 16, 2014, 3:08pm UTC](https://forum.ansible.com/t/created-an-elasticache-via-ansible-get-an-error-use-of-cache-security-groups-is-not-permitted-in-this-api-version-for-your-account/15966/2 "2014-08-16T15:08:45Z")

</div>

This I don’t know, but it seems to be coming from the AWS side of the house and not our code or boto.

If no one else here knows an answer, I’d _perhaps_ inquire with Amazon support if there’s something different about that region.

---

<div class="post-metadata">

**Author:** ![vaida.dan](https://avatars.discourse-cdn.com/v4/letter/v/5daacb/32.png) [@vaida.dan](https://forum.ansible.com/u/vaida.dan)\
**Post date:** [August 18, 2014, 7:42am UTC](https://forum.ansible.com/t/created-an-elasticache-via-ansible-get-an-error-use-of-cache-security-groups-is-not-permitted-in-this-api-version-for-your-account/15966/3 "2014-08-18T07:42:24Z")

</div>

For what it’s worth, I get a different type of error message when I try to run something similar with Redis.  
[https://github.com/ansible/ansible/issues/7986](https://github.com/ansible/ansible/issues/7986)

---

<div class="post-metadata">

**Author:** ![Shih\_Oon\_Liong2](https://avatars.discourse-cdn.com/v4/letter/s/90ced4/32.png) [@Shih\_Oon\_Liong2](https://forum.ansible.com/u/Shih_Oon_Liong2)\
**Post date:** [August 18, 2014, 5:38pm UTC](https://forum.ansible.com/t/created-an-elasticache-via-ansible-get-an-error-use-of-cache-security-groups-is-not-permitted-in-this-api-version-for-your-account/15966/4 "2014-08-18T17:38:32Z")

</div>

Thanks for the replies. I have posted a support on AWS Forum, so hopefully I get a reply back.

I have though manage to semi fixed it. It seems in some regions, AWS either ‘cache\_security\_groups’ to be empty OR ‘security\_group\_ids’ to be passed empty. The below seems to now work happily with AWS for some reason - my example uses Redis.

- name: AWS | Create Database in Redis

local\_action:  
region: sa-east-1  
module: elasticache  
name: “test-please-delete3”  
state: present  
engine: redis  
cache\_engine\_version: 2.8.6  
node\_type: cache.m1.small  
num\_nodes: 1  
cache\_port: 6379  
**cache\_security\_groups: []**  
security\_group\_ids:

- sg-x1x1x1x1  
zone: sa-east-1a

Passing an empty list to ‘cache\_security\_groups’ seems to fix it fine. This is in ansible version 1.7.1

---

<div class="post-metadata">

**Author:** ![Dhawal\_Patel](https://avatars.discourse-cdn.com/v4/letter/d/f14d63/32.png) [@Dhawal\_Patel](https://forum.ansible.com/u/Dhawal_Patel)\
**Post date:** [September 12, 2014, 7:55pm UTC](https://forum.ansible.com/t/created-an-elasticache-via-ansible-get-an-error-use-of-cache-security-groups-is-not-permitted-in-this-api-version-for-your-account/15966/5 "2014-09-12T19:55:14Z")

</div>

I get the same error when trying to create a redis cache cluster using Cloud Formation template: “Use of cache security groups is not permitted in this API version for your account.”. I’m creating a AWS::ElastiCache::SecurityGroup so I can allow access from my EC2 instances and it fails to create the SG.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [September 12, 2014, 8:05pm UTC](https://forum.ansible.com/t/created-an-elasticache-via-ansible-get-an-error-use-of-cache-security-groups-is-not-permitted-in-this-api-version-for-your-account/15966/6 "2014-09-12T20:05:23Z")

</div>

Yeah don’t know how to help with this one.

Perhaps worth asking of AWS.

---

<div class="post-metadata">

**Author:** ![Tim\_Mahoney](https://avatars.discourse-cdn.com/v4/letter/t/7ba0ec/32.png) [@Tim\_Mahoney](https://forum.ansible.com/u/Tim_Mahoney)\
**Post date:** [June 4, 2015, 5:39pm UTC](https://forum.ansible.com/t/created-an-elasticache-via-ansible-get-an-error-use-of-cache-security-groups-is-not-permitted-in-this-api-version-for-your-account/15966/7 "2015-06-04T17:39:28Z")

</div>

Hi Guys

I made a module for this, and submitted a Pull Request here: [https://github.com/ansible/ansible-modules-core/pull/1137](https://github.com/ansible/ansible-modules-core/pull/1137)

Feel free to let me know if it gives you any issues.
