9a2c0b0356e72bb525346cf0c40fe4baa80db402
[multicloud/azure.git] / azure / aria / aria-extension-cloudify / src / aria / examples / tosca-simple-1.0 / use-cases / block-storage-2 / block-storage-2.yaml
1 tosca_definitions_version: tosca_simple_yaml_1_0
2
3 description: >-
4   TOSCA simple profile with server and attached block storage using a custom AttachesTo Relationship
5   Type.
6
7 metadata:
8   template_name: block-storage-2
9   template_author: TOSCA Simple Profile in YAML
10   template_version: '1.0'
11
12 relationship_types:
13
14   MyCustomAttachesTo:
15      derived_from: AttachesTo
16
17 topology_template:
18
19   inputs:
20     cpus:
21       type: integer
22       description: Number of CPUs for the server.
23       constraints:
24         - valid_values: [ 1, 2, 4, 8 ]
25     storage_size:
26       type: scalar-unit.size
27       description: Size of the storage to be created.
28       default: 1 GB
29     storage_snapshot_id:
30       type: string
31       description: >-
32         Optional identifier for an existing snapshot to use when creating storage.
33     storage_location:
34       type: string
35       description: Block storage mount point (filesystem path).
36
37   node_templates:
38
39     my_server:
40       type: Compute
41       capabilities:
42         host:
43           properties:
44             disk_size: 10 GB
45             num_cpus: { get_input: cpus }
46             mem_size: 4 GB
47         os:
48           properties:
49             architecture: x86_64
50             type: Linux
51             distribution: Fedora
52             version: 18.0
53       requirements:
54         - local_storage:
55             node: my_storage
56             # Declare custom AttachesTo type using the 'relationship' keyword
57             relationship:
58               type: MyCustomAttachesTo
59               properties:
60                 location: { get_input: storage_location }
61
62     my_storage:
63       type: BlockStorage
64       properties:
65         size: { get_input: storage_size }
66         snapshot_id: { get_input: storage_snapshot_id }
67
68   outputs:
69     private_ip:
70       description: The private IP address of the newly created compute instance.
71       value: { get_attribute: [ my_server, private_address ] }
72
73     volume_id:
74       description: The volume id of the block storage instance.
75       value: { get_property: [ my_storage, volume_id ] } # ARIA NOTE: wrong in spec