Skip to content

Commit

Permalink
Merge pull request #27 from cloudify-examples/4.0.1.1
Browse files Browse the repository at this point in the history
4.0.1.1
  • Loading branch information
EarthmanT authored Jun 6, 2017
2 parents 47e19a3 + bbfe05b commit c551573
Show file tree
Hide file tree
Showing 12 changed files with 485 additions and 536 deletions.
2 changes: 1 addition & 1 deletion application-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ tosca_definitions_version: cloudify_dsl_1_3
########################################################

imports:
- http://www.getcloudify.org/spec/cloudify/4.0/types.yaml
- http://www.getcloudify.org/spec/cloudify/4.0.1/types.yaml
- http://www.getcloudify.org/spec/diamond-plugin/1.3.5/plugin.yaml
- types/clearwater-monitoring.yaml
- types/clearwater.yaml
Expand Down
155 changes: 63 additions & 92 deletions aws-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,36 @@ tosca_definitions_version: cloudify_dsl_1_3
########################################################

imports:
- http://www.getcloudify.org/spec/aws-plugin/1.4.4/plugin.yaml
- http://getcloudify.org.s3.amazonaws.com/spec/aws-plugin/1.4.10/plugin.yaml
- application-blueprint.yaml
- types/aws.yaml
- types/policy.yaml
- types/cloud_config/cloud-config.yaml

inputs:

key_name:
default: clearwater-blueprint-key

private_key_path:
default: ~/.ssh/clearwater-blueprint-key.pem

vpc_id:
type: string

vpc_cidr_block:
type: string

public_subnet_id:
type: string

public_subnet_cidr:
type: string

private_subnet_id:
type: string

private_subnet_cidr:
type: string

ec2_region_name:
default: us-east-1

ec2_region_endpoint:
default: ec2.us-east-1.amazonaws.com

availability_zone:
default: us-east-1e

ami:
description: >
Amazon Ubuntu 14.04 AMI
An AWS AMI. Tested with a Ubuntu 14.04 image.
default: { get_secret: ubuntu_trusty_image }

instance_type:
default: m3.medium
description: >
The AWS instance_type. Tested with m3.medium, although that is unnecessarily large.
default: m3.large

agent_user:
description: >
The username of the agent running on the instance created from the image.
default: ubuntu

dsl_definitions:

aws_config: &aws_config
aws_access_key_id: { get_secret: aws_access_key_id }
aws_secret_access_key: { get_secret: aws_secret_access_key }
ec2_region_name: { get_input: ec2_region_name }
ec2_region_endpoint: { get_input: ec2_region_endpoint }
ec2_region_name: { get_secret: ec2_region_name }
ec2_region_endpoint: { get_secret: ec2_region_endpoint }

node_templates:

Expand Down Expand Up @@ -111,7 +84,7 @@ node_templates:
- ip_protocol: tcp
from_port: 0
to_port: 65535
cidr_ip: { get_input: vpc_cidr_block }
cidr_ip: 0.0.0.0/0
- ip_protocol: udp
from_port: 161
to_port: 162
Expand Down Expand Up @@ -422,45 +395,6 @@ node_templates:
aws_config: *aws_config
domain: vpc

vpc:
type: cloudify.aws.nodes.VPC
properties:
aws_config: *aws_config
use_external_resource: true
resource_id: { get_input: vpc_id }
cidr_block: { get_input: vpc_cidr_block }

public_subnet:
type: cloudify.aws.nodes.Subnet
properties:
aws_config: *aws_config
use_external_resource: true
resource_id: { get_input: public_subnet_id }
cidr_block: { get_input: public_subnet_cidr }
availability_zone: { get_input: availability_zone }
relationships:
- type: cloudify.aws.relationships.subnet_contained_in_vpc
target: vpc

private_subnet:
type: cloudify.aws.nodes.Subnet
properties:
aws_config: *aws_config
use_external_resource: true
resource_id: { get_input: private_subnet_id }
cidr_block: { get_input: private_subnet_cidr }
availability_zone: { get_input: availability_zone }
relationships:
- type: cloudify.aws.relationships.subnet_contained_in_vpc
target: vpc

key:
type: cloudify.aws.nodes.KeyPair
properties:
aws_config: *aws_config
resource_id: { get_input: key_name }
private_key_path: { get_input: private_key_path }

ellis_vm:
type: clearwater.nodes.MonitoredServer
properties:
Expand All @@ -476,8 +410,6 @@ node_templates:
target: all_nodes_external
- type: cloudify.aws.relationships.instance_connected_to_security_group
target: ellis_vm_security_group
- type: cloudify.aws.relationships.instance_connected_to_keypair
target: key
- target: public_subnet
type: cloudify.aws.relationships.instance_contained_in_subnet

Expand All @@ -498,8 +430,6 @@ node_templates:
target: bono_vm_security_group
- type: cloudify.aws.relationships.instance_connected_to_security_group
target: bono_to_others_security_group
- type: cloudify.aws.relationships.instance_connected_to_keypair
target: key
- target: public_subnet
type: cloudify.aws.relationships.instance_contained_in_subnet

Expand All @@ -516,8 +446,6 @@ node_templates:
target: sprout_vm_security_group
- type: cloudify.aws.relationships.instance_connected_to_security_group
target: sprout_to_others_security_group
- type: cloudify.aws.relationships.instance_connected_to_keypair
target: key
- target: private_subnet
type: cloudify.aws.relationships.instance_contained_in_subnet

Expand All @@ -534,8 +462,6 @@ node_templates:
target: homestead_vm_security_group
- type: cloudify.aws.relationships.instance_connected_to_security_group
target: homestead_to_others_security_group
- type: cloudify.aws.relationships.instance_connected_to_keypair
target: key
- target: private_subnet
type: cloudify.aws.relationships.instance_contained_in_subnet

Expand All @@ -552,8 +478,6 @@ node_templates:
target: homer_vm_security_group
- type: cloudify.aws.relationships.instance_connected_to_security_group
target: homer_to_others_security_group
- type: cloudify.aws.relationships.instance_connected_to_keypair
target: key
- target: private_subnet
type: cloudify.aws.relationships.instance_contained_in_subnet

Expand All @@ -570,8 +494,6 @@ node_templates:
target: ralf_vm_security_group
- type: cloudify.aws.relationships.instance_connected_to_security_group
target: ralf_to_others_security_group
- type: cloudify.aws.relationships.instance_connected_to_keypair
target: key
- target: private_subnet
type: cloudify.aws.relationships.instance_contained_in_subnet

Expand All @@ -586,11 +508,60 @@ node_templates:
target: all_nodes_external
- type: cloudify.aws.relationships.instance_connected_to_security_group
target: bind_host_security_group
- type: cloudify.aws.relationships.instance_connected_to_keypair
target: key
- target: private_subnet
type: cloudify.aws.relationships.instance_contained_in_subnet


public_subnet:
type: cloudify.aws.nodes.Subnet
properties:
aws_config: *aws_config
use_external_resource: true
resource_id: { get_secret: public_subnet_id }
cidr_block: N/A
availability_zone: N/A
relationships:
- type: cloudify.aws.relationships.subnet_contained_in_vpc
target: vpc

private_subnet:
type: cloudify.aws.nodes.Subnet
properties:
aws_config: *aws_config
use_external_resource: true
resource_id: { get_secret: private_subnet_id }
cidr_block: N/A
availability_zone: N/A
relationships:
- type: cloudify.aws.relationships.subnet_contained_in_vpc
target: vpc

vpc:
type: cloudify.aws.nodes.VPC
properties:
aws_config: *aws_config
use_external_resource: true
resource_id: { get_secret: vpc_id }
cidr_block: N/A
relationships:
- type: cloudify.relationships.depends_on
target: cloudify_host_cloud_config

cloudify_host_cloud_config:
type: cloudify.nodes.CloudConfig
interfaces:
cloudify.interfaces.lifecycle:
create:
inputs:
cloud_config:
users:
- name: { get_input: agent_user }
groups: sudo
shell: /bin/bash
sudo: ['ALL=(ALL) NOPASSWD:ALL']
ssh-authorized-keys:
- { get_secret: agent_key_public }

########################################################

bono:
Expand Down
Loading

0 comments on commit c551573

Please sign in to comment.