d3c2614c9a530162e0b60cfefda67417209557c5
[multicloud/azure.git] / azure / aria / aria-extension-cloudify / src / aria / examples / tosca-simple-1.0 / use-cases / block-storage-4 / block-storage-4.yaml
1 tosca_definitions_version: tosca_simple_yaml_1_0
2
3 description: >-
4   TOSCA simple profile with a Single Block Storage node shared by 2-Tier Application with custom
5   AttachesTo Type and implied relationships.
6
7 metadata:
8   template_name: block-storage-4
9   template_author: TOSCA Simple Profile in YAML
10   template_version: '1.0'
11
12 relationship_types:
13
14   MyAttachesTo:
15     derived_from: tosca.relationships.AttachesTo
16     properties:
17       location:
18         type: string
19         default: /default_location
20
21 topology_template:
22
23   inputs:
24     cpus:
25       type: integer
26       description: Number of CPUs for the server.
27       constraints:
28         - valid_values: [ 1, 2, 4, 8 ]
29     storage_size:
30       type: scalar-unit.size
31       default: 1 GB
32       description: Size of the storage to be created.
33     storage_snapshot_id:
34       type: string
35       description: >-
36         Optional identifier for an existing snapshot to use when creating storage.
37
38   node_templates:
39
40     my_web_app_tier_1:
41       type: tosca.nodes.Compute
42       capabilities:
43         host:
44           properties:
45             disk_size: 10 GB
46             num_cpus: { get_input: cpus }
47             mem_size: 4096 MB
48         os:
49           properties:
50             architecture: x86_64
51             type: Linux
52             distribution: Fedora
53             version: 18.0
54       requirements:
55         - local_storage:
56             node: my_storage
57             relationship: MyAttachesTo
58
59     my_web_app_tier_2:
60       type: tosca.nodes.Compute
61       capabilities:
62         host:
63           properties:
64             disk_size: 10 GB
65             num_cpus: { get_input: cpus }
66             mem_size: 4096 MB
67         os:
68           properties:
69             architecture: x86_64
70             type: Linux
71             distribution: Fedora
72             version: 18.0
73       requirements:
74         - local_storage:
75             node: my_storage
76             relationship:
77               type: MyAttachesTo
78               properties:
79                 location: /some_other_data_location
80
81     my_storage:
82       type: tosca.nodes.BlockStorage
83       properties:
84         size: { get_input: storage_size }
85         snapshot_id: { get_input: storage_snapshot_id }
86
87   outputs:
88     private_ip_1:
89       description: The private IP address of the application's first tier.
90       value: { get_attribute: [ my_web_app_tier_1, private_address ] }
91     private_ip_2:
92       description: The private IP address of the application's second tier.
93       value: { get_attribute: [ my_web_app_tier_2, private_address ] }
94     volume_id:
95       description: The volume id of the block storage instance.
96       value: { get_property: [ my_storage, volume_id ] } # ARIA NOTE: wrong in spec