add heat template for bottlenecks
[bottlenecks.git] / utils / infra_setup / heat_template / bottlenecks_template1.yaml
1 heat_template_version: 2014-10-16
2
3 description: template to deploy a instance used for bottlenecks project
4
5 parameters:
6   image:
7     type: string
8     label: Image name or ID
9     description: Image to be used for deploying instance
10     default: your_image_name
11   flavor:
12     type: string
13     label: Flavor
14     description: Type of instance (flavor) to be used
15     default: m1.medium
16   key:
17     type: string
18     label: Key name
19     description: Name of key-pair to be used for deploying instance
20     default: your_key
21   public_network:
22     type: string
23     label: Public network name or ID
24     description: Network to attach instance to.
25     default: your_public_net
26
27 resources:
28   web_server_security_group:
29     type: OS::Neutron::SecurityGroup
30     properties:
31       name: web_server_security_group
32       rules:
33         - protocol: tcp
34           port_range_min: 80
35           port_range_max: 80
36         - protocol: tcp
37           port_range_min: 443
38           port_range_max: 443
39         - protocol: icmp
40         - protocol: tcp
41           port_range_min: 22
42           port_range_max: 22
43   private_network:
44     type: OS::Neutron::Net
45
46   private_subnet:
47     type: OS::Neutron::Subnet
48     properties:
49       network_id: {get_resource: private_network }
50       cidr: 10.10.10.0/24 #change it according to your own requirement
51       dns_nameservers:
52         - 8.8.8.8
53
54   router:
55     type: OS::Neutron::Router
56     properties:
57       external_gateway_info:
58         network: { get_param: public_network }
59
60   router-interface:
61     type: OS::Neutron::RouterInterface
62     properties:
63       router_id: { get_resource: router }
64       subnet: { get_resource: private_subnet }
65
66   floating_ip:
67     type: OS::Neutron::FloatingIP
68     properties:
69       floating_network: { get_param: public_network }
70
71   floating_ip_assoc:
72     type: OS::Neutron::FloatingIPAssociation
73     properties:
74       floatingip_id: { get_resource: floating_ip }
75       port_id: { get_resource: bottlenecks_port }
76
77   bottlenecks_port:
78     type: OS::Neutron::Port
79     properties:
80       network: { get_resource: private_network }
81       security_groups:
82         - { get_resource: web_server_security_group }
83
84   bottlenecks_instance:
85     type: OS::Nova::Server
86     properties:
87       image: { get_param: image }
88       flavor: { get_param: flavor }
89       key_name: { get_param: key }
90       networks:
91         - port: { get_resource: bottlenecks_port }
92       user_data_format: RAW
93       user_data: |
94         #!/bin/sh -ex
95
96         echo "hello world"
97
98 outputs:
99   instance_name:
100     description: Name of the instance
101     value: { get_attr: [bottlenecks_instance, name] }
102   instance_ip:
103     description: IP address of the deployed instance
104     value: { get_attr: [floating_ip, floating_ip_address] }