AWSTemplateFormatVersion: 2010-09-09
Resources:
  cachegroupa:
    Type: 'AWS::ElastiCache::SubnetGroup'
    Properties:
      CacheSubnetGroupName: !Ref SubGroupName
      Description: !Ref SubGroupName
      SubnetIds:
        - !Ref dbnet1id
        - !Ref dbnet2id
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 486b56bc-dec0-4b7b-8eef-f551f8311495
  cachecluster:
    Type: 'AWS::ElastiCache::CacheCluster'
    Properties:
      AZMode: cross-az
      Engine: memcached
      ClusterName: !Ref ClusterName
      NumCacheNodes: '2'
      Port: '11211'
      CacheNodeType: cache.t3.micro
      VpcSecurityGroupIds:
        - !Ref MemcacheSecurity
      CacheSubnetGroupName: !Ref cachegroupa
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 51592334-29be-446e-a1ee-df4f7a6d3c1d
Parameters:
  MemcacheSecurity:
    Type: String
  dbnet1id:
    Type: String
  dbnet2id:
    Type: String
  ClusterName:
    Type: String
    Default: elasticache-memcached
  SubGroupName:
    Type: String
    Default: elasticachegroupa
Metadata:
  'AWS::CloudFormation::Designer':
    486b56bc-dec0-4b7b-8eef-f551f8311495:
      size:
        width: 240
        height: 240
      position:
        x: 60
        'y': 90
      z: 1
      embeds:
        - 51592334-29be-446e-a1ee-df4f7a6d3c1d
    51592334-29be-446e-a1ee-df4f7a6d3c1d:
      size:
        width: 60
        height: 60
      position:
        x: 90
        'y': 150
      z: 2
      parent: 486b56bc-dec0-4b7b-8eef-f551f8311495
      embeds: []
      iscontainedinside:
        - 486b56bc-dec0-4b7b-8eef-f551f8311495
        - 486b56bc-dec0-4b7b-8eef-f551f8311495