932f13157052de0d3db4bb289deede2217dcde00
[sdc/sdc-distribution-client.git] /
1 tosca_definitions_version: tosca_simple_yaml_1_0
2
3 description: >
4   This TOSCA simple profile deploys nodejs, mongodb, elasticsearch, logstash and kibana each on a separate server
5   with monitoring enabled for nodejs server where a sample nodejs application is running. The rsyslog and collectd are
6   installed on a nodejs server.
7
8 imports:
9   - paypalpizzastore_nodejs_app.yaml
10   - elasticsearch.yaml
11   - logstash.yaml
12   - kibana.yaml
13   - collectd.yaml
14   - rsyslog.yaml
15
16 dsl_definitions:
17     host_capabilities: &host_capabilities
18       # container properties (flavor)
19       disk_size: 10 GB
20       num_cpus: { get_input: my_cpus }
21       mem_size: 4096 MB
22     os_capabilities: &os_capabilities
23       architecture: x86_64
24       type: Linux
25       distribution: Ubuntu
26       version: 14.04
27
28 topology_template:
29   inputs:
30     my_cpus:
31       type: integer
32       description: Number of CPUs for the server.
33       constraints:
34         - valid_values: [ 1, 2, 4, 8 ]
35     github_url:
36        type: string
37        description: The URL to download nodejs.
38        default: http://github.com/paypal/rest-api-sample-app-nodejs.git
39
40   node_templates:
41     paypal_pizzastore:
42       type: tosca.nodes.WebApplication.PayPalPizzaStore
43       properties:
44           github_url: { get_input: github_url }
45       requirements:
46         - host: nodejs
47         - database_connection: mongo_db
48       interfaces:
49         Standard:
50            configure:
51              implementation: ../Scripts/nodejs/config.sh
52              inputs:
53                github_url: { get_property: [ SELF, github_url ] }
54                mongodb_ip: { get_attribute: [mongo_server, private_address] }
55            start: ../Scripts/nodejs/start.sh
56     nodejs:
57       type: tosca.nodes.WebServer
58       requirements:
59         - host:
60             node: app_server
61       interfaces:
62         Standard:
63           create: ../Scripts/nodejs/create.sh
64     mongo_db:
65       type: tosca.nodes.Database
66       requirements:
67         - host: mongo_dbms
68       interfaces:
69         Standard:
70           create: ../Scripts/mongodb/create_database.sh
71     mongo_dbms:
72       type: tosca.nodes.DBMS
73       requirements:
74         - host: mongo_server
75       interfaces:
76         Standard:
77           create: ../Scripts/mongodb/create.sh
78           configure:
79             implementation: ../Scripts/mongodb/config.sh
80             inputs:
81               mongodb_ip: { get_attribute: [mongo_server, private_address] }
82           start: ../Scripts/mongodb/start.sh
83     elasticsearch:
84       type: tosca.nodes.SoftwareComponent.Elasticsearch
85       requirements:
86         - host: elasticsearch_server
87       interfaces:
88         Standard:
89           create: ../Scripts/elasticsearch/create.sh
90           start: ../Scripts/elasticsearch/start.sh
91     logstash:
92       type: tosca.nodes.SoftwareComponent.Logstash
93       requirements:
94         - host: logstash_server
95         - search_endpoint:
96             node: elasticsearch
97             capability: search_endpoint
98             relationship:
99               type: tosca.relationships.ConnectsTo
100               interfaces:
101                 Configure:
102                   pre_configure_source:
103                     implementation: ../Python/logstash/configure_elasticsearch.py
104                     inputs:
105                       elasticsearch_ip: { get_attribute: [elasticsearch_server, private_address] }
106       interfaces:
107         Standard:
108           create: ../Scripts/logstash/create.sh
109           start: ../Scripts/logstash/start.sh
110     kibana:
111       type: tosca.nodes.SoftwareComponent.Kibana
112       requirements:
113         - host: kibana_server
114         - search_endpoint: elasticsearch
115       interfaces:
116         Standard:
117           create: ../Scripts/kibana/create.sh
118           configure:
119             implementation: ../Scripts/kibana/config.sh
120             inputs:
121               elasticsearch_ip: { get_attribute: [elasticsearch_server, private_address] }
122               kibana_ip: { get_attribute: [kibana_server, private_address] }
123           start: ../Scripts/kibana/start.sh
124     app_collectd:
125       type: tosca.nodes.SoftwareComponent.Collectd
126       requirements:
127         - host: app_server
128         - log_endpoint:
129             node: logstash
130             capability: log_endpoint
131             relationship:
132               type: tosca.relationships.ConnectsTo
133               interfaces:
134                 Configure:
135                   pre_configure_target:
136                     implementation: ../Python/logstash/configure_collectd.py
137       interfaces:
138         Standard:
139           create: ../Scripts/collectd/create.sh
140           configure:
141             implementation: ../Python/collectd/config.py
142             inputs:
143               logstash_ip: { get_attribute: [logstash_server, private_address] }
144           start: ../Scripts/collectd/start.sh
145     app_rsyslog:
146       type: tosca.nodes.SoftwareComponent.Rsyslog
147       requirements:
148         - host: app_server
149         - log_endpoint:
150             node: logstash
151             capability: log_endpoint
152             relationship:
153               type: tosca.relationships.ConnectsTo
154               interfaces:
155                 Configure:
156                   pre_configure_target:
157                     implementation: ../Python/logstash/configure_rsyslog.py
158       interfaces:
159         Standard:
160           create: ../Scripts/rsyslog/create.sh
161           configure:
162             implementation: ../Scripts/rsyslog/config.sh
163             inputs:
164               logstash_ip: { get_attribute: [logstash_server, private_address] }
165           start: ../Scripts/rsyslog/start.sh
166     app_server:
167       type: tosca.nodes.Compute
168       capabilities:
169         host:
170           properties: *host_capabilities
171         os:
172           properties: *os_capabilities
173     mongo_server:
174       type: tosca.nodes.Compute
175       capabilities:
176         host:
177           properties: *host_capabilities
178         os:
179           properties: *os_capabilities
180     elasticsearch_server:
181       type: tosca.nodes.Compute
182       capabilities:
183         host:
184           properties: *host_capabilities
185         os:
186           properties: *os_capabilities
187     logstash_server:
188       type: tosca.nodes.Compute
189       capabilities:
190         host:
191           properties: *host_capabilities
192         os:
193           properties: *os_capabilities
194     kibana_server:
195       type: tosca.nodes.Compute
196       capabilities:
197         host:
198           properties: *host_capabilities
199         os:
200           properties: *os_capabilities
201
202   outputs:
203     nodejs_url:
204       description: URL for the nodejs server, http://<IP>:3000
205       value: { get_attribute: [ app_server, private_address ] }
206     mongodb_url:
207       description: URL for the mongodb server.
208       value: { get_attribute: [ mongo_server, private_address ] }
209     elasticsearch_url:
210       description: URL for the elasticsearch server.
211       value: { get_attribute: [ elasticsearch_server, private_address ] }
212     logstash_url:
213       description: URL for the logstash server.
214       value: { get_attribute: [ logstash_server, private_address ] }
215     kibana_url:
216       description: URL for the kibana server.
217       value: { get_attribute: [ kibana_server, private_address ] }