heat-templates/hot/multi_region_hello_world.yaml

83 lines
2.4 KiB
YAML

#
# This is a multi region hello world HOT template defining two remote stacks
# in different regions.
#
heat_template_version: 2013-05-23
description: >
Hello world HOT template that defines two remote stacks, one for RegionOne
and one for RegionTwo, using the hello_world.yaml template.
parameters:
key_name:
type: string
description: Name of an existing key pair to use for the server
constraints:
- custom_constraint: nova.keypair
flavor:
type: string
description: Flavor for the server to be created
default: m1.small
constraints:
- custom_constraint: nova.flavor
image:
type: string
description: Image ID or image name to use for the server
constraints:
- custom_constraint: glance.image
admin_pass:
type: string
description: Admin password
hidden: true
constraints:
- length: { min: 6, max: 8 }
description: Password length must be between 6 and 8 characters
- allowed_pattern: "[a-zA-Z0-9]+"
description: Password must consist of characters and numbers only
- allowed_pattern: "[A-Z]+[a-zA-Z0-9]*"
description: Password must start with an uppercase character
db_port:
type: number
description: Database port number
default: 50000
constraints:
- range: { min: 40000, max: 60000 }
description: Port number must be between 40000 and 60000
resources:
stack_one:
type: OS::Heat::Stack
properties:
context:
region_name: RegionOne
template: { get_file: "hello_world.yaml" }
timeout: 60
parameters:
key_name: { get_param: key_name }
image: { get_param: image }
flavor: { get_param: flavor }
admin_pass: { get_param: admin_pass }
db_port: { get_param: db_port }
stack_two:
type: OS::Heat::Stack
properties:
context:
region_name: RegionTwo
template: { get_file: "hello_world.yaml" }
timeout: 60
parameters:
key_name: { get_param: key_name }
image: { get_param: image }
flavor: { get_param: flavor }
admin_pass: { get_param: admin_pass }
db_port: { get_param: db_port }
outputs:
stack_one_outputs:
description: Output of stack_one.
value: { get_attr: [stack_one, outputs] }
stack_two_outputs:
description: Output of stack_two.
value: { get_attr: [stack_two, outputs] }