[openstack-dev] [Heat] Referencing VPC resources across templates

Steve Baker sbaker at redhat.com
Wed Apr 3 21:40:25 UTC 2013


On 04/03/2013 08:29 PM, Simon Pasquier wrote:
> Hi,
>
> Let say I have a first template to create a VPC network and another
> one to create a subnet associated to that VPC.
>
> First template:
> {
>    "AWSTemplateFormatVersion" : "2010-09-09",
>    "Resources" : {
>       "myVPC" : {
>          "Type" : "AWS::EC2::VPC",
>          "Properties" : {
>             "CidrBlock" : "20.0.0.0/16 <http://20.0.0.0/16>"
>          }
>       }
>    },
>    "Outputs" : {
>     "VpcID" : {
>       "Value" : { "Ref" : "myVPC" },
>       "Description" : "Reference of the myVPC"
>     } 
>    }
> }
>
> Second template:
> {
>    "AWSTemplateFormatVersion" : "2010-09-09",
>  
>    "Parameters" : {
>     "VpcId" : {
>       "Type" : "String",
>       "Description" : "VpcId of your existing Virtual Private Cloud (VPC)"
>     }
>    },
>  
>    "Resources" : {
>     "mySubnet" : {
>          "Type" : "AWS::EC2::Subnet",
>          "Properties" : {
>             "VpcId" : { "Ref" : "VpcId" },
>             "CidrBlock" : "20.0.0.0/24 <http://20.0.0.0/24>",
>             "AvailabilityZone" : "us-east-1a"
>          }
>       }
>    },
>    "Outputs" : {
>     "SubnetId" : {
>       "Value" : { "Ref" : "mySubnet" },
>       "Description" : "Reference to mySubnet"
>     } 
>    }
> }
>
> I want to pass the VpcId value as a parameter to the second template
> but the stack creation fails. Looking at the code, this use case
> doesn't seem to be supported.
> Am I right? If yes, is it something planned for a future release?
What version of Heat are you running? There was actually a change
released in grizzly-rc1 which addressed this issue:
https://bugs.launchpad.net/heat/+bug/1142812
https://review.openstack.org/#/c/23391/

If this doesn't work for you could you raise a launchpad bug?

cheers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130404/06cd83dd/attachment.html>


More information about the OpenStack-dev mailing list