[openstack-dev] [heat] cross-stack references

Steven Hardy shardy at redhat.com
Wed Sep 18 18:03:54 UTC 2013


On Wed, Sep 18, 2013 at 01:34:43PM -0400, Mike Spreitzer wrote:
> When we get into things like affinity concerns or managing network 
> bandwidth, we see the need for cross-stack relationships.  You may want to 
> place parts of a new stack near parts of an existing one, for example.  I 
> see that in CFN you can make cross-references between different parts of a 
> single stack using the resource names that appear in the original 
> template.  Is there a way to refer to something that did not come from the 
> same original template?  If not, won't we need such a thing to be 
> introduced?  Any thoughts on how that would be done?

Unless I'm misunderstanding your question, this is already possible, you
just need to reference the output values of nested stacks.

There are a couple of ways to do this:

1. Use our implementation of the AWS::CloudFormation::Stack resource

An example of this approach can be found here:

https://github.com/openstack/heat-templates/blob/master/cfn/F17/WordPress_Composed_Instances.template#L136

"Fn::GetAtt" : [ "DatabaseTemplate", "Outputs.PublicIp" ]

2. Use a "Provider Resource"

Provider resources are new for Havana, and are essentially the Heat native
interface to nested stacks (where a template can be defined as a custom
resource, optionally overriding existing resources via an environment file)

We're still working on docs and examples of Provder Resources, but you
basically access the outputs of the provider template via a resource
attribute, ie in a similar way to above.

HTH,

Steve



More information about the OpenStack-dev mailing list