-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathtest-ec2-bp.yaml
68 lines (61 loc) · 2.16 KB
/
test-ec2-bp.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
tosca_definitions_version: cloudify_dsl_1_3
description: >
This blueprint defines a EC2 VM created using Cloudify's AWS plugin
and a simple web server started using Cloudify's script plugin.
In addition, an elastic IP and a security group are created and associated with the created VM.
imports:
- http://www.getcloudify.org/spec/cloudify/4.0/types.yaml
- http://www.getcloudify.org/spec/aws-plugin/1.4.10/plugin.yaml
inputs:
webserver_port:
description: The HTTP web server port
default: 8080
agent_user:
description: User name used when SSH-ing into the started machine
default: ec2-user
image_id:
description: AWS EC2 image id to use for the server
instance_type:
description: AWS EC2 instance type to use for the server
default: m3.medium
node_templates:
elastic_ip:
type: cloudify.aws.nodes.ElasticIP
security_group:
type: cloudify.aws.nodes.SecurityGroup
properties:
description: Security group for Hello World VM
rules:
- ip_protocol: tcp
cidr_ip: 0.0.0.0/0
from_port: { get_property: [ http_web_server, port ] }
to_port: { get_property: [ http_web_server, port ] }
vm:
type: cloudify.aws.nodes.Instance
properties:
agent_config:
user: { get_input: agent_user }
image_id: { get_input: image_id }
instance_type: { get_input: instance_type }
relationships:
- type: cloudify.aws.relationships.instance_connected_to_elastic_ip
target: elastic_ip
- type: cloudify.aws.relationships.instance_connected_to_security_group
target: security_group
http_web_server:
type: cloudify.nodes.WebServer
properties:
port: { get_input: webserver_port }
relationships:
- type: cloudify.relationships.contained_in
target: vm
interfaces:
cloudify.interfaces.lifecycle:
configure: scripts/configure.sh
start: scripts/start.sh
stop: scripts/stop.sh
outputs:
http_endpoint:
description: Web server's external endpoint
value: { concat: ['http://', { get_attribute: [elastic_ip, aws_resource_id] },
':', { get_property: [http_web_server, port] }] }