AWS CloudFormation how to to Create ElastiCache Cluster with Security Group Configuration
I've looked through the documentation and I'm still confused about I've been struggling with this for a few days now and could really use some help. I'm trying to create an Amazon ElastiCache cluster using AWS CloudFormation, but I'm running into issues with the security group configuration. Despite following the documentation, I'm receiving the behavior message: `CREATE_FAILED: AWS::ElastiCache::CacheCluster - ClusterName: my-cache-cluster, SecurityGroupIds: Template behavior: Every Security Group must have at least one inbound or outbound rule`. Here's a snippet of my CloudFormation template: ```yaml Resources: MyCacheCluster: Type: AWS::ElastiCache::CacheCluster Properties: CacheNodeType: cache.t3.micro Engine: redis CacheClusterId: my-cache-cluster NumCacheNodes: 1 VpcSecurityGroupIds: - !Ref MySecurityGroup MySecurityGroup: Type: AWS::EC2::SecurityGroup Properties: GroupDescription: Security group for ElastiCache VpcId: !Ref MyVPC SecurityGroupIngress: - IpProtocol: tcp FromPort: 6379 ToPort: 6379 CidrIp: 0.0.0.0/0 ``` I've made sure to specify the `SecurityGroupIngress` rules, which allows inbound traffic on port 6379 for Redis. I also ensured that the `VpcId` is correctly set for my VPC. However, the behavior continues during stack creation. I even tried simplifying the template by removing the security group and using the default one, but that didn't work either. Can anyone advise on what I might be missing or any best practices regarding configuring security groups for ElastiCache in a CloudFormation template? For context: I'm using Yaml on Ubuntu. What am I doing wrong? Any help would be greatly appreciated! Could someone point me to the right documentation?