No export named vpc-xxxxxx-vpc-id found. Rollback requested by user

Viewed 1417

I am quite new to AWS and I am trying to launch a security group from and cloud formation: I have this in my parameters

  NetworkStackName:
   Description: "Network Stack Name which created connectivity resources (subnets, routing, etc)."
   Type: String
   Default: vpc-xxxx

And it is being referenced in my resources as follows

Resources:

  JUMPsgID:
     Type: 'AWS::EC2::SecurityGroup'
     Properties:
       VpcId:
         Fn::ImportValue: !Sub "${NetworkStackName}:vpc-id"

when I try to lauch the template, I get this error

AWS::CloudFormation::Stack ROLLBACK_IN_PROGRESS No export named vpc-xxx:vpc-id found. Rollback requested by user.

I am sure it has something to do with this line Fn::ImportValue: !Sub "${NetworkStackName}:vpc-id" but I am not sure how to resolve this?

1 Answers

NetworkStackName is not the VPC ID. It should be the name of CloudFormation (CFN) stack which creates the VPC.

So check in the CFN, which is the name of the stack containing the VPC of interest. The use it as a default value in NetworkStackName parameter, or just pass it as such.

Related