title: CreateStack operation: Template format error: Unresolved resource dependencies [VpcId] in the Resources block of the template
body: <p>I am working with multiple CF templates, and intend to export and import values across the templates. I exported/imported most values fine, however run into this problem where VpcId is not being imported for some reason. </p>
  
  <p>First template with export</p>
  
  <pre><code>Parameters:
    StackPrefix:
      Type: String
      Default: "app-name"
  
  Outputs:
    VpcId:
      Value: !Ref VPC
      Export:
        Name: !Join [ ":", [ !Ref StackPrefix, VPC ] ]
  </code></pre>
  
  <p>Second template with import</p>
  
  <pre><code>Parameters:
    StackPrefix:
      Type: String
      Default: "app-name"
  
  Resources:
    SecurityGroup:
      Type: "AWS::EC2::SecurityGroup"
      Properties:
        GroupDescription: !Sub ${AWS::StackName}-alb
        SecurityGroupIngress:
          - CidrIp: "0.0.0.0/0"
            IpProtocol: "TCP"
            FromPort: 80
            ToPort: 80
        VpcId:
          Fn::ImportValue: !Sub "${StackPrefix}:VPC"
  </code></pre>
  
  <p>Deploying the template with <code>aws cli</code> results in a "template validation error"</p>
  
  <p><code>aws --profile shiny-app cloudformation create-stack --stack-name app-elb --template-body file://02-load-balancer.yaml</code></p>
  
  <pre><code>An error occurred (ValidationError) when calling the CreateStack operation: Template format error: Unresolved resource dependencies [VpcId] in the Resources block of the template
  </code></pre>
  
  <p>Any help is appreciated</p>