title: AWS CloudFormation use existing security group
body: <p>I want to use existing security group on cloudformation template.
  Now I have template that create 2 SG,</p>
  
  <pre><code> "InstanceMember1": {
        "Type": "AWS::EC2::Instance",
        "Properties": {
          "SubnetId": {
            "Ref": "privateSubnetA"
          },
          "SecurityGroupIds": [
            {
              "Ref": "MongoSg"
            },
            {
              "Ref": "mongoTrafficSG"
            } 
          ],
      }
  }
  
  "MongoSg": {
        "Type": "AWS::EC2::SecurityGroup",
        "Properties": {
          "GroupDescription": "MongoDB security group",
          "SecurityGroupIngress": [
            {
              "IpProtocol": "tcp",
              "FromPort": "22",
              "ToPort": "22",
              "SourceSecurityGroupId": {
                "Ref": "bastionSG"
              }
            }
          ],
          "VpcId": "%%vpc-id%%",
        }
  }
  }
  </code></pre>
  
  <p>Now I want to add to the instance exist security group id, any advice?</p>