Add ability to combine roles into one role.
[apex-tripleo-heat-templates.git] / heat.yaml
1 HeatTemplateFormatVersion: '2012-12-12'
2 Description: 'HEAT Template - Heat Engine and API'
3 Parameters:
4   KeyName: 
5     Description: Name of an existing EC2 KeyPair to enable SSH access to the instances
6     Type: String
7     Default: default
8   InstanceType:
9     Description: Use this flavor
10     Type: String
11     Default: bm.small
12   HeatUser:
13     Description: Heat database username.
14     Type: String
15     Default: heat
16   HeatEngineImage:
17     Type: String
18   HeatApiImage:
19     Type: String
20   RabbitMQHost:
21     Description: Host for RabbitMQ
22     Type: String
23   RabbitMQPassword:
24     Description: Password for RabbitMQ
25     Type: String
26   ApiGroupSize:
27     Description: How many API nodes to run
28     Type: Integer
29     Default: 1
30   AvailabilityZones:
31     Type: List
32     Default: [ 1 ]
33   TemplateURL:
34     Type: String
35     Default: https://raw.github.com/openstack-ops/templates/master/
36 Resources:
37   EngineAccessPolicy:
38     Type: OS::Heat::AccessPolicy
39     Properties:
40       AllowedResources: [ HeatEngine ]
41   EngineUser:
42     Type: AWS::IAM::User
43     Properties:
44       Policies: [ { Ref: EngineAccessPolicy } ]
45   EngineKey:
46     Type: AWS::IAM::AccessKey
47     Properties:
48       UserName:
49         Ref: EngineUser
50   ApiAccessPolicy:
51     Type: OS::Heat::AccessPolicy
52     Properties:
53       AllowedResources: [ HeatAPI, HeatAPILaunch ]
54   ApiUser:
55     Type: AWS::IAM::User
56     Properties:
57       Policies: [ { Ref: ApiAccessPolicy } ]
58   ApiKey:
59     Type: AWS::IAM::AccessKey
60     Properties:
61       UserName:
62         Ref: ApiUser
63   HeatAPILaunch:
64     Type: AWS::AutoScaling::LaunchConfiguration
65     Metadata:
66       OpenStack::ImageBuilder::Elements: [ heat-api ]
67       heat:
68         rpc_backend: heat.openstack.common.rpc.impl_kombu
69         rabbit:
70           host: {Ref: RabbitMQHost}
71           password: {Ref: RabbitMQPassword}
72         access_key_id:
73           Ref: ApiKey
74         secret_key:
75           Fn::GetAtt: [ ApiKey, SecretAccessKey ]
76         stack:
77           name: {Ref: 'AWS::StackName'}
78           region: {Ref: 'AWS::Region'}
79         refresh:
80           - resource: HeatAPILaunch
81     Properties:
82       ImageId:
83         {Ref: HeatApiImage}
84       InstanceType: {Ref: InstanceType}
85       KeyName: {Ref: KeyName}
86   HeatAPI:
87     Type: OS::Heat::InstanceGroup
88     Properties:
89       LaunchConfiguration: {Ref: HeatApiLaunch}
90       Size: {Ref: ApiGroupSize}
91       AvailabilityZones: {Ref: AvailabilityZones}
92   HeatEngine:
93     Type: AWS::EC2::Instance
94     Properties:
95       ImageId:
96         {Ref: HeatEngineImage}
97     Metadata:
98       heat:
99         rpc_backend: heat.openstack.common.rpc.impl_kombu
100         rabbit:
101           host: {Ref: RabbitMQHost}
102           password: {Ref: RabbitMQPassword}
103         access_key_id:
104           Ref: EngineKey
105         secret_key:
106           Fn::GetAtt: [ EngineKey, SecretAccessKey ]
107         stack:
108           name: {Ref: 'AWS::StackName'}
109           region: {Ref: 'AWS::Region'}
110         refresh:
111           - resource: HeatEngine