Skip to content
This repository was archived by the owner on Mar 1, 2020. It is now read-only.

Commit

Permalink
Merge pull request #5 from cloudify-examples/update-cfy4
Browse files Browse the repository at this point in the history
updating for cfy 4.0
  • Loading branch information
EarthmanT committed Apr 12, 2017
2 parents ef6747f + eebf1fd commit 6aad7f4
Show file tree
Hide file tree
Showing 9 changed files with 155 additions and 194 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ If you use the Hybrid version, you need to set/specify (as an input to the bluep

### Step 1: Installation

`cfy install upload -b <choose_blueprint_id> -p <blueprint_filename>` <br>

If you have or want to use an inputs file : <br>
`cfy install upload -b <choose_blueprint_id> -p <blueprint_filename> -i <your_inputs_file>` <br>
`cfy install <blueprint_filename> -i <your_inputs_file> -b drupal` <br>

This process will create all the cloud resources needed for the application and the application itself ...: <br>

Expand Down Expand Up @@ -81,7 +78,7 @@ You can simulate a failed host by stopping or suspending a running memcacheD VM.
Now lets run the `uninstall` workflow. This will uninstall the application,
as well as delete all related resources. <br>

`cfy uninstall -d <deployment_id>`
`cfy uninstall drupal`

### For more info, you can Watch [this video](https://www.youtube.com/watch?v=GaUMZKtS8ws)

117 changes: 51 additions & 66 deletions aws-blueprint.yaml
Original file line number Diff line number Diff line change
@@ -1,71 +1,57 @@
tosca_definitions_version: cloudify_dsl_1_3

imports:
- http://www.getcloudify.org/spec/cloudify/3.4/types.yaml
- http://www.getcloudify.org/spec/cloudify/4.0/types.yaml
- http://www.getcloudify.org/spec/aws-plugin/1.4.4/plugin.yaml
- http://www.getcloudify.org/spec/diamond-plugin/1.3.5/plugin.yaml
- http://www.getcloudify.org/spec/aws-plugin/1.4.3/plugin.yaml
- scale.yaml


inputs:

aws_access_key_id:
description: YOUR AWS ACCESS KEY ID

aws_secret_access_key:
description: YOUR AWS SECRET ACCESS KEY

ec2_region_name:
default: us-east-1

ec2_region_endpoint:
default: ec2.us-east-1.amazonaws.com
key_name:
default: drupal-blueprint-key

availability_zone:
default: us-east-1e

aws_config:
default:
aws_access_key_id: { get_input: aws_access_key_id }
aws_secret_access_key: { get_input: aws_secret_access_key }
ec2_region_name: { get_input: ec2_region_name }
ec2_region_endpoint: { get_input: ec2_region_endpoint }
private_key_path:
default: ~/.ssh/drupal-blueprint-key.pem

vpc_id:
description: Your AWS Managers VPC.
type: string

vpc_cidr_block:
default: 172.16.0.0/16
type: string

public_subnet_id:
description: The public subnet in your VPC.
type: string

public_subnet_cidr:
default: 172.16.122.0/24

public_subnet_availability_zone:
default: { get_input: availability_zone }
type: string

private_subnet_id:
description: The private subnet in your VPC.
type: string

private_subnet_cidr:
default: 172.16.123.0/24
type: string

private_subnet_availability_zone:
default: { get_input: availability_zone }
ec2_region_name:
default: us-east-1

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

availability_zone:
default: us-east-1e

ami:
description: >
Amazon Ubuntu 14.04 AMI
agent_private_key_path:
# RAM: 4096 MB, Hard Disk 80 GB, 2 vCPUs
instance_type:
type: string
default: '~/.ssh/drupal.pem'
default: 'm3.large'

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

docRoot:
default: /var/www/html
Expand All @@ -79,16 +65,6 @@ inputs:
memcachePort:
default: 11211

# Ubuntu 14.04
image_id:
type: string
default: 'ami-c93a83de'

# RAM: 4096 MB, Hard Disk 80 GB, 2 vCPUs
instance_type:
type: string
default: 'm3.large'

drupal_security_group_name:
type: string
default: 'Drupal_AWS_Security_Group'
Expand All @@ -101,6 +77,14 @@ inputs:
type:
default: 'http://repository.cloudifysource.org/org/cloudifysource/examples/drupal/babies_image_d7_v2.zip'

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 }

node_types:

###########################################################
Expand All @@ -111,10 +95,8 @@ node_types:
host:
derived_from: cloudify.aws.nodes.Instance
properties:
aws_config:
default: { get_input: aws_config }
image_id:
default: { get_input: image_id }
default: { get_input: ami }
instance_type:
default: { get_input: instance_type }
parameters:
Expand All @@ -123,9 +105,8 @@ node_types:
agent_config:
default:
install_method: remote
port: 22
user: { get_input: agent_user }
key: { get_input: agent_private_key_path }
key: { get_input: private_key_path }
interfaces:
utils.ops:
restart_vm_op: utils-scripts/restart_vm.sh
Expand Down Expand Up @@ -285,7 +266,7 @@ node_templates:
drupal_security_group:
type: cloudify.aws.nodes.SecurityGroup
properties:
aws_config: { get_input: aws_config }
aws_config: *aws_config
resource_id: { get_input: drupal_security_group_name }
description: Security group for Cloudify Manager VM
rules:
Expand Down Expand Up @@ -340,7 +321,7 @@ node_templates:
apache_ip:
type: cloudify.aws.nodes.ElasticIP
properties:
aws_config: { get_input: aws_config }
aws_config: *aws_config
domain: vpc
capabilities:
scalable:
Expand All @@ -352,6 +333,8 @@ node_templates:

mysql_vm:
type: host
properties:
aws_config: *aws_config
relationships:
- type: cloudify.aws.relationships.instance_connected_to_security_group
target: drupal_security_group
Expand All @@ -362,6 +345,8 @@ node_templates:

memcached_vm:
type: host
properties:
aws_config: *aws_config
relationships:
- type: cloudify.aws.relationships.instance_connected_to_security_group
target: drupal_security_group
Expand All @@ -373,6 +358,7 @@ node_templates:
apache_vm:
type: host
properties:
aws_config: *aws_config
parameters:
placement: { get_property: [ public_subnet, availability_zone ] }
relationships:
Expand Down Expand Up @@ -486,7 +472,6 @@ node_templates:
drupal.interfaces.action:
install_project: drupal-scripts/drush-install.sh
set_variable: drupal-scripts/drush-setvar.sh

relationships:
- type: cloudify.relationships.contained_in
target: drupal_server
Expand All @@ -498,41 +483,41 @@ node_templates:
public_subnet:
type: cloudify.aws.nodes.Subnet
properties:
aws_config: { get_input: aws_config }
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: public_subnet_availability_zone }
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: { get_input: aws_config }
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: private_subnet_availability_zone }
availability_zone: { get_input: availability_zone }
relationships:
- type: cloudify.aws.relationships.subnet_contained_in_vpc
target: vpc

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

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

plugins:

Expand Down
Loading

0 comments on commit 6aad7f4

Please sign in to comment.