Ensure AWS Elasticache security groups are defined

Error: AWS Elasticache security groups are not defined

Bridgecrew Policy ID: BC_AWS_NETWORKING_68
Checkov Check ID: CKV_AWS_196
Severity: LOW

AWS Elasticache security groups are not defined

Description

By ensuring that AWS Elasticache security groups are defined, you can help protect your clusters from unauthorized access and ensure that only authorized traffic is allowed to reach your clusters. This can help prevent data breaches and other security incidents, and can also help ensure that your clusters are not overwhelmed by unwanted traffic.

Fix - Buildtime

Terraform

resource "aws_elasticache_security_group" "exists" {
  name                 = "elasticache-security-group"
  security_group_names = [aws_security_group.bar.name]
}

resource "aws_security_group" "bar" {
  name = "security-group"
}