use openstack-db
[apex-tripleo-heat-templates.git] / keystone.yaml
1 HeatTemplateFormatVersion: '2012-12-12'
2 Description: 'HEAT Template - Keystone'
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   KeystoneDSN:
13     Description: DSN for connecting to keystone
14     Type: String
15   KeystoneImage:
16     Type: String
17 Resources:
18   ApiAccessPolicy:
19     Type: OS::Heat::AccessPolicy
20     Properties:
21       AllowedResources: [ KeystoneLaunch, Keystone ]
22   ApiUser:
23     Type: AWS::IAM::User
24     Properties:
25       Policies: [ { Ref: ApiAccessPolicy } ]
26   ApiKey:
27     Type: AWS::IAM::AccessKey
28     Properties:
29       UserName:
30         Ref: ApiUser
31   KeystoneLaunch:
32     Type: AWS::AutoScaling::LaunchConfiguration
33     Properties:
34       ImageId:
35         {Ref: KeystoneImage}
36       InstanceType: {Ref: InstanceType}
37       KeyName: {Ref: KeyName}
38     Metadata:
39       OpenStack::Heat::CFNTools:
40         AWSAccessKeyId:
41           Ref: ApiKey
42         AWSSecretAccessKey:
43           Fn::GetAtt: [ ApiKey, SecretAccessKey ]
44       OpenStack::ImageBuilder::Elements: [ keystone ]
45       OpenStack:
46         keystone:
47           db: {Ref: KeystoneDSN}
48   Keystone:
49     Type: OS::Heat::InstanceGroup
50     Properties:
51       LaunchConfigurationName: { Ref: KeystoneLaunch }
52       AvailabilityZones: [ 1 ]
53       Size: '1'