title: AWS CloudFormation: Unable to find existing SG to assign to RDS instance
body: <p>Created and exported a SG from one template/stack:</p>
  
  <pre><code>  Resources
      RDSSecurityGroup:
        Type: AWS::EC2::SecurityGroup
        Properties:
          GroupName: "sg-name" 
  
    Outputs:
      SGRDS:
        Description: security group of rds instances
        Value: !Ref RDSSecurityGroup
        Export:
          Name: SGRDS
  </code></pre>
  
  <p>However, although the export is created when trying to use this SG in an RDS creation using another template (and stack)</p>
  
  <pre><code> Resources
     MYRDS: 
       Type: AWS::RDS::DBInstance
         Properties: 
         DBSecurityGroups:
          - !ImportValue SGRDS
  </code></pre>
  
  <p>it fails with the following error:</p>
  
  <blockquote>
    <p>DBSecurityGroup not found: sg-0983409kdje5999</p>
  </blockquote>
  
  <p><strong>Update</strong>: This does not seem to be a problem related to the exported value; assigning the specific SG to my RDS instance for some reason fails either way (I explicitly used the SG name, but I get the above "not found" error with the name instead of the id this time). </p>
  
  <p>For some reason it fails to find the SG.</p>