vFW and vDNS support added to azure-plugin
[multicloud/azure.git] / azure / aria / aria-extension-cloudify / examples / aws-hello-world / aws-helloworld.yaml
1 tosca_definitions_version: tosca_simple_yaml_1_0
2
3 imports:
4   - https://raw.githubusercontent.com/cloudify-cosmo/aria-extension-cloudify/master/plugins/aws/plugin.yaml
5   - aria-1.0
6
7 node_types:
8   http_web_server:
9     derived_from: tosca.nodes.WebApplication
10     properties:
11       port:
12         type: integer
13
14 topology_template:
15   inputs:
16     webserver_port:
17       description: The HTTP web server port
18       type: integer
19       default: 8080
20     image_id:
21       description: AWS EC2 image id to use for the server
22       type: string
23     instance_type:
24       description: AWS EC2 instance type to use for the server
25       type: string
26       default: m3.medium
27     ssh_username:
28       type: string
29       default: ubuntu
30     ssh_port:
31       type: integer
32       default: 22
33     private_key_path:
34       description: Path to the private key used to authenticate into the instance
35       type: string
36
37   node_templates:
38     elastic_ip:
39       type: aria.aws.nodes.ElasticIP
40
41     security_group:
42       type: aria.aws.nodes.SecurityGroup
43       properties:
44         description: Security group for Hello World VM
45         rules:
46           - ip_protocol: tcp
47             cidr_ip: 0.0.0.0/0
48             from_port: { get_property: [ http_web_server, port ] }
49             to_port: { get_property: [ http_web_server, port ] }
50           - ip_protocol: tcp
51             cidr_ip: 0.0.0.0/0
52             from_port: { get_input: ssh_port }
53             to_port: { get_input: ssh_port }
54
55     vm:
56       type: aria.aws.nodes.Instance
57       properties:
58         image_id: { get_input: image_id }
59         instance_type: { get_input: instance_type }
60         name: aria-aws-hello-world-instance
61         parameters:
62           key_name: { get_attribute: [ keypair, aws_resource_id ] }
63       requirements:
64         - elastic_ip: elastic_ip
65         - security_group: security_group
66         - keypair: keypair
67
68     keypair:
69       type: aria.aws.nodes.KeyPair
70       properties:
71         private_key_path: { get_input: private_key_path }
72
73     http_web_server:
74       type: http_web_server
75       properties:
76         port: { get_input: webserver_port }
77       requirements:
78         - host: vm
79       interfaces:
80         Standard:
81           configure:
82             implementation:
83               primary: scripts/configure.sh
84               dependencies:
85                 - "ssh.user > { get_input: ssh_username }"
86                 - "ssh.key_filename > { get_input: private_key_path }"
87                 - "ssh.address > { get_attribute: [ vm, public_ip_address ] }"
88           start:
89             implementation:
90               primary: scripts/start.sh
91               dependencies:
92                 - "ssh.user > { get_input: ssh_username }"
93                 - "ssh.key_filename > { get_input: private_key_path }"
94                 - "ssh.address > { get_attribute: [ vm, public_ip_address ] }"
95           stop:
96             implementation:
97               primary: scripts/stop.sh
98               dependencies:
99                 - "ssh.user > { get_input: ssh_username }"
100                 - "ssh.key_filename > { get_input: private_key_path }"
101                 - "ssh.address > { get_attribute: [ vm, public_ip_address ] }"