Skip to main content

cache_security_groups

Creates, updates, deletes, gets or lists a cache_security_groups resource.

Overview

Namecache_security_groups
TypeResource
Idaws.elasticache.cache_security_groups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe ARN of the cache security group,
cache_security_group_namestringThe name of the cache security group.
descriptionstringThe description of the cache security group.
ec2_security_groupsstringA list of Amazon EC2 security groups that are associated with this cache security group.
owner_idstringThe Amazon account ID of the cache security group owner.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_cache_security_groupsselectregionCacheSecurityGroupName, MaxRecords, MarkerReturns 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_groupinsertCacheSecurityGroupName, regionDescription, TagsCreates 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_ingressupdateCacheSecurityGroupName, EC2SecurityGroupName, EC2SecurityGroupOwnerId, regionAllows 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_groupdeleteCacheSecurityGroupName, regionDeletes a cache security group. You cannot delete a cache security group if it is associated with any clusters.
revoke_cache_security_group_ingressexecCacheSecurityGroupName, EC2SecurityGroupName, EC2SecurityGroupOwnerId, regionRevokes 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.

NameDatatypeDescription
CacheSecurityGroupNamestringThe name of the cache security group to revoke ingress from.
EC2SecurityGroupNamestringThe name of the Amazon EC2 security group to revoke access from.
EC2SecurityGroupOwnerIdstringThe 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.
regionstringAWS region (default: us-east-1)
CacheSecurityGroupNamestringThe name of the cache security group to return details for.
DescriptionstringA description for the cache security group.
MarkerstringAn 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.
MaxRecordsintegerThe 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.
TagsarrayA 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

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

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
;

UPDATE examples

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

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

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
;