tosca_definitions_version: tosca_simple_yaml_1.2
description: TOSCA simple profile with vote, result, worker, redis and postgree on two virtual servers
topology_template:
node_templates:
vote: 
type: tosca.nodes.WebApplication.Vote
properties:
port: 5000:80
requirements:
- database_endpoint: redis
- host:app-server1
- host:app-server2
interfaces:
Standard:
Create: 
implementation:
primary: votingusecase/vote/app.py
dependencies: 
- votingusecase/vote/requirements.txt
result: 
type: tosca.nodes.WebApplication.Result
properties:
port: 5001:80
requirements:
- database_endpoint: postgres
- host:app-server1
- host:app-server2
interfaces:
Standard:
Create: 
implementation:
primary: votingusecase/result/server.js
dependencies: 
- votingusecase/result/package.json
worker: 
type: tosca.nodes.Container.Application.Docker
artifacts:
workerimage:
file: dockersamples/examplevotingapp_worker
type: tosca.artifacts.Deployment.Image.Container.Docker
repository: docker_hub            
requirements:
- host:app-server2
interfaces:
Standard:
Create: 
implementation: workerimage
postgres: 
type: tosca.nodes.Container.Application.Docker
artifacts:
postgresimage:
file: postgres:9.4
type: tosca.artifacts.Deployment.Image.Container.Docker
repository: docker_hub
requirements:
- host:app-server1
- host:app-server2
interfaces:
Standard:
Create: 
implementation: postgresimage
redis: 
type: tosca.nodes.Container.Application.Docker
artifacts:
redisimage:
file: redis:alpine
type: tosca.artifacts.Deployment.Image.Container.Docker
repository: docker_hub
requirements:
- host:app-server1
- host:app-server2
interfaces:
Standard:
Create: 
implementation: redisimage
app-server1: 
type: tosca.nodes.Compute
capabilities:
host:
properties:
disk_size: 10 GB
num_cpus: 2
mem_size: 8 GB
OS:
properties:
architecture: x86_64
type: Linux
distribution: ubuntu
version: 12.04
app-server2: 
type: tosca.nodes.Compute
capabilities:
host:
properties:
disk_size: 10 GB
num_cpus: 2
mem_size: 8 GB
OS:
properties:
architecture: x86_64
type: Linux
distribution: ubuntu
version: 12.04
