vFW and vDNS support added to azure-plugin
[multicloud/azure.git] / azure / aria / aria-extension-cloudify / src / aria / examples / tosca-simple-1.0 / use-cases / webserver-dbms-2 / webserver-dbms-2.yaml
1 tosca_definitions_version: tosca_simple_yaml_1_0
2
3 description: >-
4   TOSCA simple profile with a nodejs web server hosting a PayPal sample application which connects
5   to a mongodb database.
6
7 metadata:
8   template_name: webserver-dbms-2
9   template_author: TOSCA Simple Profile in YAML
10   template_version: '1.0'
11
12 imports:
13   - custom_types/paypalpizzastore_nodejs_app.yaml
14
15 dsl_definitions:
16
17   ubuntu_node: &ubuntu_node
18     disk_size: 10 GB
19     num_cpus: { get_input: my_cpus }
20     mem_size: 4096 MB
21   os_capabilities: &os_capabilities
22     architecture: x86_64
23     type: Linux
24     distribution: Ubuntu
25     version: 14.04
26
27 topology_template:
28
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       default: 1
36     github_url:
37       type: string
38       description: The URL to download nodejs.
39       default:  https://github.com/sample.git
40
41   node_templates:
42
43     paypal_pizzastore:
44       type: tosca.nodes.WebApplication.PayPalPizzaStore
45       properties:
46           github_url: { get_input: github_url }
47       requirements:
48         - host: nodejs
49         - database_connection: mongo_db
50       interfaces:
51         Standard:
52            configure:
53              implementation: scripts/nodejs/configure.sh
54              inputs:
55                github_url: { get_property: [ SELF, github_url ] }
56                mongodb_ip: { get_attribute: [ mongo_server, private_address ] }
57            start: scripts/nodejs/start.sh
58
59     nodejs:
60       type: tosca.nodes.WebServer.Nodejs
61       requirements:
62         - host: app_server
63       interfaces:
64         Standard:
65           create: scripts/nodejs/create.sh
66
67     mongo_db:
68       type: tosca.nodes.Database
69       properties:
70         name: 'pizzastore' # ARIA NOTE: missing in spec
71       requirements:
72         - host: mongo_dbms
73       interfaces:
74         Standard:
75          create: create_database.sh
76
77     mongo_dbms:
78       type: tosca.nodes.DBMS
79       requirements:
80         - host: mongo_server
81       properties:
82         port: 27017
83       interfaces:
84         Standard: # ARIA NOTE: mistaken in spec
85           create: mongodb/create.sh
86           configure:
87             implementation: mongodb/config.sh
88             inputs:
89               mongodb_ip: { get_attribute: [ mongo_server, private_address ] }
90           start: mongodb/start.sh
91
92     mongo_server:
93       type: tosca.nodes.Compute
94       capabilities:
95         os:
96           properties: *os_capabilities
97         host:
98           properties: *ubuntu_node
99
100     app_server:
101       type: tosca.nodes.Compute
102       capabilities:
103         os:
104           properties: *os_capabilities
105         host:
106           properties: *ubuntu_node
107
108   outputs:
109
110     nodejs_url:
111       description: URL for the nodejs server, http://<IP>:3000
112       value: { get_attribute: [ app_server, private_address ] }
113     mongodb_url:
114       description: URL for the mongodb server.
115       value: { get_attribute: [ mongo_server, private_address ] }