Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Commit 19ded60

Browse files
author
earthmant
committed
Making AWS more user friendly
changing region to a lower demand region (i hope) replacing need for nat instance updating readme adding awssdk nat gateway
1 parent 7e67a3c commit 19ded60

3 files changed

Lines changed: 44 additions & 97 deletions

File tree

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,14 @@ When you execute the blueprint, you will provision the following resources in yo
3232

3333
* AWS Infrastructure:
3434
* subnet0_nic_eip0
35-
* subnet0_nic_eip1
35+
* elasticip_nat_gateway
3636
* vpc
3737
* internet_gateway
3838
* subnet0
3939
* subnet1
40-
* nat_instance_security_group
40+
* nat_gateway
4141
* cloudify_security_group
4242
* subnet0_nic0
43-
* subnet0_nic1
44-
* nat_instance
4543
* route_table0
4644
* route_table1
4745
* cloudify_host_cloud_config

aws-blueprint.yaml

Lines changed: 35 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ tosca_definitions_version: cloudify_dsl_1_3
33
imports:
44
- https://raw.githubusercontent.com/cloudify-cosmo/cloudify-manager/4.1/resources/rest-service/cloudify/types/types.yaml
55
- https://raw.githubusercontent.com/cloudify-cosmo/cloudify-aws-plugin/1.5/plugin.yaml
6+
- https://raw.githubusercontent.com/cloudify-incubator/cloudify-awssdk-plugin/master/plugin.yaml
67
- https://raw.githubusercontent.com/cloudify-incubator/cloudify-utilities-plugin/1.2.5/plugin.yaml
78
- imports/manager-configuration.yaml
89

@@ -15,10 +16,10 @@ inputs:
1516
description: YOUR AWS SECRET ACCESS KEY
1617

1718
ec2_region_name:
18-
default: us-east-1
19+
default: us-west-1
1920

2021
ec2_region_endpoint:
21-
default: ec2.us-east-1.amazonaws.com
22+
default: ec2.us-west-1.amazonaws.com
2223

2324
cloudify_image_username:
2425
default: centos
@@ -36,27 +37,12 @@ inputs:
3637
default: { concat: [ { get_input: local_ssh_directory }, { get_input: manager_key_name } ] }
3738

3839
availability_zone:
39-
default: us-east-1e
40+
default: us-west-1c
4041

4142
default_tags:
4243
default:
4344
owner: hello@getcloudify.org
4445

45-
nat_image_id:
46-
description: >
47-
An AWS NAT instance AMI. Default is for region us-east-1.
48-
For other regions, search Community AMIs: amzn-ami-vpc-nat-pv-2014.09.1.x86_64-ebs.
49-
default: ami-224dc94a
50-
51-
nat_instance_type:
52-
default: t1.micro
53-
54-
nat_instance_block_device_mapping:
55-
default:
56-
'/dev/sda1':
57-
size: 8
58-
delete_on_termination: true
59-
6046
cloudify_host_block_device_mapping:
6147
default:
6248
'/dev/sda1':
@@ -73,16 +59,16 @@ inputs:
7359
ami-d195e3bd on sa-east-1 region
7460
ami-ab210ed0 on us-east-1 region
7561
For a vanilla CentOS ami, try: ami-0fbdf765 (us-east-1), change cloudify_image_username: ec2-user, and change cloudify_host_block_device_mapping from '/dev/sda1' to '/dev/sda'.
76-
default: ami-ab210ed0
62+
default: ami-58361d38
7763

7864
cloudify_instance_type:
7965
default: m3.large
8066

8167
centos_core_image:
82-
default: ami-0fbdf765
68+
default: ami-36f7a656
8369

8470
ubuntu_trusty_image:
85-
default: ami-772aa961
71+
default: ami-b2527ad2
8672

8773
manager_ip:
8874
description: >
@@ -138,6 +124,11 @@ dsl_definitions:
138124
ec2_region_name: { get_input: ec2_region_name }
139125
ec2_region_endpoint: { get_input: ec2_region_endpoint }
140126

127+
aws_config: &aws_config
128+
aws_access_key_id: { get_input: aws_access_key_id }
129+
aws_secret_access_key: { get_input: aws_secret_access_key }
130+
region_name: { get_input: ec2_region_name }
131+
141132
node_templates:
142133

143134
manager_key:
@@ -179,13 +170,6 @@ node_templates:
179170
tags: { get_input: default_tags }
180171
domain: vpc
181172

182-
subnet0_nic_eip1:
183-
type: cloudify.aws.nodes.ElasticIP
184-
properties:
185-
aws_config: *client_config
186-
tags: { get_input: default_tags }
187-
domain: vpc
188-
189173
vpc:
190174
type: cloudify.aws.nodes.VPC
191175
properties:
@@ -228,20 +212,25 @@ node_templates:
228212
- type: cloudify.relationships.depends_on
229213
target: internet_gateway
230214

231-
nat_instance_security_group:
232-
type: cloudify.aws.nodes.SecurityGroup
215+
elasticip_nat_gateway:
216+
type: cloudify.aws.nodes.ElasticIP
233217
properties:
234218
aws_config: *client_config
235219
tags: { get_input: default_tags }
236-
description: Cloudify Community AMI NAT Security Group
237-
rules:
238-
- ip_protocol: -1
239-
from_port: -1
240-
to_port: -1
241-
cidr_ip: 0.0.0.0/0
220+
domain: vpc
242221
relationships:
243-
- type: cloudify.aws.relationships.security_group_contained_in_vpc
244-
target: vpc
222+
- type: cloudify.relationships.depends_on
223+
target: subnet1
224+
225+
nat_gateway:
226+
type: cloudify.nodes.aws.ec2.NATGateway
227+
properties:
228+
client_config: *aws_config
229+
relationships:
230+
- type: cloudify.relationships.depends_on
231+
target: subnet0
232+
- type: cloudify.relationships.depends_on
233+
target: elasticip_nat_gateway
245234

246235
cloudify_security_group:
247236
type: cloudify.aws.nodes.SecurityGroup
@@ -315,44 +304,6 @@ node_templates:
315304
- type: cloudify.aws.relationships.connected_to_security_group
316305
target: cloudify_security_group
317306

318-
subnet0_nic1:
319-
type: cloudify.aws.nodes.Interface
320-
properties:
321-
aws_config: *client_config
322-
tags: { get_input: default_tags }
323-
relationships:
324-
- type: cloudify.aws.relationships.connected_to_subnet
325-
target: subnet0
326-
- type: cloudify.aws.relationships.connected_to_elastic_ip
327-
target: subnet0_nic_eip1
328-
- type: cloudify.aws.relationships.connected_to_security_group
329-
target: nat_instance_security_group
330-
331-
nat_instance:
332-
type: cloudify.aws.nodes.Instance
333-
properties:
334-
aws_config: *client_config
335-
tags: { get_input: default_tags }
336-
name: NAT Instance
337-
image_id: { get_input: nat_image_id }
338-
instance_type: { get_input: nat_instance_type }
339-
agent_config:
340-
install_method: none
341-
parameters:
342-
block_device_map: { get_input: nat_instance_block_device_mapping }
343-
interfaces:
344-
cloudify.interfaces.lifecycle:
345-
configure:
346-
implementation: aws.cloudify_aws.ec2.instance.modify_attributes
347-
inputs:
348-
new_attributes:
349-
sourceDestCheck: false
350-
relationships:
351-
- type: cloudify.aws.relationships.instance_contained_in_subnet
352-
target: subnet0
353-
- type: cloudify.aws.relationships.instance_connected_to_eni
354-
target: subnet0_nic1
355-
356307
route_table0:
357308
type: cloudify.aws.nodes.RouteTable
358309
properties:
@@ -372,21 +323,19 @@ node_templates:
372323
aws_config: *client_config
373324
tags: { get_input: default_tags }
374325
relationships:
375-
interfaces:
376-
cloudify.interfaces.lifecycle:
377-
create:
378-
implementation: aws.cloudify_aws.vpc.routetable.create_route_table
379-
inputs:
380-
routes:
381-
- destination_cidr_block: 0.0.0.0/0
382-
instance_id: { get_attribute: [ nat_instance, aws_resource_id ] }
383326
relationships:
384327
- type: cloudify.aws.relationships.routetable_contained_in_vpc
385328
target: vpc
386329
- type: cloudify.aws.relationships.routetable_associated_with_subnet
387330
target: subnet1
388-
- type: cloudify.relationships.connected_to
389-
target: nat_instance
331+
- type: cloudify.aws.relationships.route_table_to_gateway
332+
target: nat_gateway
333+
target_interfaces:
334+
cloudify.interfaces.relationship_lifecycle:
335+
establish:
336+
implementation: aws.cloudify_aws.vpc.routetable.create_route_to_gateway
337+
inputs:
338+
destination_cidr_block: 0.0.0.0/0
390339

391340
cloudify_host_cloud_config:
392341
type: cloudify.nodes.CloudInit.CloudConfig

inputs/aws.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
aws_secret_access_key: -cut-
22
aws_access_key_id: -cut-
3-
# cloudify_ami: ami-75ef7763
4-
cloudify_ami: ami-0fbdf765 # When bootstrap: True
5-
cloudify_image_username: ec2-user
6-
cloudify_host_block_device_mapping:
7-
'/dev/sda':
8-
delete_on_termination: true
9-
bootstrap: True
3+
4+
# Possible variation if using bootstrap
5+
#cloudify_image_username: ec2-user
6+
#cloudify_host_block_device_mapping:
7+
# '/dev/sda':
8+
# delete_on_termination: true
9+
# bootstrap: True

0 commit comments

Comments
 (0)