The environment is used to affect the runtime behaviour of the template. It provides a way to override the default resource implementation and the parameters passed to Heat.
It is a yaml text file with two main sections “resource_registry” and “parameters”.
heat stack-create my_stack -e my_env.yaml -P "some_parm=bla" -f my_tmpl.yaml
If you do not like the option “-e my_env.yaml”, you can put file my_env.yaml in “/etc/heat/environment.d/” and restart heat engine. Then, you can use the heat client as in the example below:
heat stack-create my_stack -P "some_parm=bla" -f my_tmpl.yaml
parameters:
KeyName: heat_key
InstanceType: m1.micro
ImageId: F18-x86_64-cfntools
resource_registry:
"OS::Quantum*": "OS::Neutron*"
So all existing resources which can be matched with “OS::Neutron*” will be mapped to “OS::Quantum*” accordingly.
resource_registry:
"AWS::EC2::Instance": file:///home/mine/my_instance_with_better_defaults.yaml
Please note that the template resource URL here must end with ”.yaml” or ”.template”, or it will not be treated as a custom template resource.
resource_registry:
"OS::Networking::FloatingIP": "OS::Nova::FloatingIP"
resource_registry:
resources:
my_db_server:
"OS::DBInstance": file:///home/mine/all_my_cool_templates/db.yaml