cache_security_groups
Creates, updates, deletes, gets or lists a cache_security_groups resource.
Overview
| Name | cache_security_groups |
| Type | Resource |
| Id | aws.elasticache.cache_security_groups |
Fields
The following fields are returned by SELECT queries:
- describe_cache_security_groups
| Name | Datatype | Description |
|---|---|---|
arn | string | The ARN of the cache security group, |
cache_security_group_name | string | The name of the cache security group. |
description | string | The description of the cache security group. |
ec2_security_groups | string | A list of Amazon EC2 security groups that are associated with this cache security group. |
owner_id | string | The Amazon account ID of the cache security group owner. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_cache_security_groups | select | region | CacheSecurityGroupName, MaxRecords, Marker | Returns a list of cache security group descriptions. If a cache security group name is specified, the list contains only the description of that group. This applicable only when you have ElastiCache in Classic setup |
create_cache_security_group | insert | CacheSecurityGroupName, region | Description, Tags | Creates a new cache security group. Use a cache security group to control access to one or more clusters. Cache security groups are only used when you are creating a cluster outside of an Amazon Virtual Private Cloud (Amazon VPC). If you are creating a cluster inside of a VPC, use a cache subnet group instead. For more information, see CreateCacheSubnetGroup. |
authorize_cache_security_group_ingress | update | CacheSecurityGroupName, EC2SecurityGroupName, EC2SecurityGroupOwnerId, region | Allows network ingress to a cache security group. Applications using ElastiCache must be running on Amazon EC2, and Amazon EC2 security groups are used as the authorization mechanism. You cannot authorize ingress from an Amazon EC2 security group in one region to an ElastiCache cluster in another region. | |
delete_cache_security_group | delete | CacheSecurityGroupName, region | Deletes a cache security group. You cannot delete a cache security group if it is associated with any clusters. | |
revoke_cache_security_group_ingress | exec | CacheSecurityGroupName, EC2SecurityGroupName, EC2SecurityGroupOwnerId, region | Revokes ingress from a cache security group. Use this operation to disallow access from an Amazon EC2 security group that had been previously authorized. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
CacheSecurityGroupName | string | The name of the cache security group to revoke ingress from. |
EC2SecurityGroupName | string | The name of the Amazon EC2 security group to revoke access from. |
EC2SecurityGroupOwnerId | string | The Amazon account number of the Amazon EC2 security group owner. Note that this is not the same thing as an Amazon access key ID - you must provide a valid Amazon account number for this parameter. |
region | string | AWS region (default: us-east-1) |
CacheSecurityGroupName | string | The name of the cache security group to return details for. |
Description | string | A description for the cache security group. |
Marker | string | An optional marker returned from a prior request. Use this marker for pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords. |
MaxRecords | integer | The maximum number of records to include in the response. If more records exist than the specified MaxRecords value, a marker is included in the response so that the remaining results can be retrieved. Default: 100 Constraints: minimum 20; maximum 100. |
Tags | array | A list of tags to be added to this resource. A tag is a key-value pair. A tag key must be accompanied by a tag value, although null is accepted. |
SELECT examples
- describe_cache_security_groups
Returns a list of cache security group descriptions. If a cache security group name is specified, the list contains only the description of that group. This applicable only when you have ElastiCache in Classic setup
SELECT
arn,
cache_security_group_name,
description,
ec2_security_groups,
owner_id
FROM aws.elasticache.cache_security_groups
WHERE region = '{{ region }}' -- required
AND CacheSecurityGroupName = '{{ CacheSecurityGroupName }}'
AND MaxRecords = '{{ MaxRecords }}'
AND Marker = '{{ Marker }}'
;
INSERT examples
- create_cache_security_group
- Manifest
Creates a new cache security group. Use a cache security group to control access to one or more clusters. Cache security groups are only used when you are creating a cluster outside of an Amazon Virtual Private Cloud (Amazon VPC). If you are creating a cluster inside of a VPC, use a cache subnet group instead. For more information, see CreateCacheSubnetGroup.
INSERT INTO aws.elasticache.cache_security_groups (
CacheSecurityGroupName,
region,
Description,
Tags
)
SELECT
'{{ CacheSecurityGroupName }}',
'{{ region }}',
'{{ Description }}',
'{{ Tags }}'
RETURNING
arn,
cache_security_group_name,
description,
ec2_security_groups,
owner_id
;
# Description fields are for documentation purposes
- name: cache_security_groups
props:
- name: CacheSecurityGroupName
value: "{{ CacheSecurityGroupName }}"
description: Required parameter for the cache_security_groups resource.
- name: region
value: "{{ region }}"
description: Required parameter for the cache_security_groups resource.
- name: Description
value: "{{ Description }}"
description: A description for the cache security group.
description: A description for the cache security group.
- name: Tags
value: "{{ Tags }}"
description: A list of tags to be added to this resource. A tag is a key-value pair. A tag key must be accompanied by a tag value, although null is accepted.
description: A list of tags to be added to this resource. A tag is a key-value pair. A tag key must be accompanied by a tag value, although null is accepted.
UPDATE examples
- authorize_cache_security_group_ingress
Allows network ingress to a cache security group. Applications using ElastiCache must be running on Amazon EC2, and Amazon EC2 security groups are used as the authorization mechanism. You cannot authorize ingress from an Amazon EC2 security group in one region to an ElastiCache cluster in another region.
UPDATE aws.elasticache.cache_security_groups
SET
-- No updatable properties
WHERE
CacheSecurityGroupName = '{{ CacheSecurityGroupName }}' --required
AND EC2SecurityGroupName = '{{ EC2SecurityGroupName }}' --required
AND EC2SecurityGroupOwnerId = '{{ EC2SecurityGroupOwnerId }}' --required
AND region = '{{ region }}' --required
RETURNING
arn,
cache_security_group_name,
description,
ec2_security_groups,
owner_id;
DELETE examples
- delete_cache_security_group
Deletes a cache security group. You cannot delete a cache security group if it is associated with any clusters.
DELETE FROM aws.elasticache.cache_security_groups
WHERE CacheSecurityGroupName = '{{ CacheSecurityGroupName }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- revoke_cache_security_group_ingress
Revokes ingress from a cache security group. Use this operation to disallow access from an Amazon EC2 security group that had been previously authorized.
EXEC aws.elasticache.cache_security_groups.revoke_cache_security_group_ingress
@CacheSecurityGroupName='{{ CacheSecurityGroupName }}' --required,
@EC2SecurityGroupName='{{ EC2SecurityGroupName }}' --required,
@EC2SecurityGroupOwnerId='{{ EC2SecurityGroupOwnerId }}' --required,
@region='{{ region }}' --required
;