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

Commit ee4ec03

Browse files
author
earthmant
committed
adding aws ami check
1 parent 19ded60 commit ee4ec03

File tree

1 file changed

+55
-12
lines changed

1 file changed

+55
-12
lines changed

aws-blueprint.yaml

+55-12
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ inputs:
4848
'/dev/sda1':
4949
delete_on_termination: true
5050

51-
cloudify_ami:
51+
cloudify_manager_ami:
5252
description: >
5353
A Cloudify Manager AMI. Default is for region us-east-1.
5454
Other available regions:
@@ -59,17 +59,11 @@ inputs:
5959
ami-d195e3bd on sa-east-1 region
6060
ami-ab210ed0 on us-east-1 region
6161
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'.
62-
default: ami-58361d38
62+
default: { get_attribute: [ cloudify_manager_ami, aws_resource_id ] }
6363

6464
cloudify_instance_type:
6565
default: m3.large
6666

67-
centos_core_image:
68-
default: ami-36f7a656
69-
70-
ubuntu_trusty_image:
71-
default: ami-b2527ad2
72-
7367
manager_ip:
7468
description: >
7569
Resolving the IP for manager setup.
@@ -96,9 +90,9 @@ inputs:
9690
- key: availability_zone
9791
value: { get_input: availability_zone }
9892
- key: ubuntu_trusty_image
99-
value: { get_input: ubuntu_trusty_image }
93+
value: { get_attribute: [ ubuntu_trusty_ami, aws_resource_id ] }
10094
- key: centos_core_image
101-
value: { get_input: centos_core_image }
95+
value: { get_attribute: [ centos_core_ami, aws_resource_id ] }
10296
- key: agent_key_public
10397
value: { get_attribute: [ agent_key, public_key_export ] }
10498
- key: agent_key_private
@@ -131,6 +125,48 @@ dsl_definitions:
131125

132126
node_templates:
133127

128+
centos_core_ami:
129+
type: cloudify.nodes.aws.ec2.Image
130+
properties:
131+
resource_config:
132+
kwargs:
133+
Filters:
134+
- Name: name
135+
Values:
136+
- 'CentOS 7.3.1611 x86_64 with cloud-init (HVM)'
137+
- Name: owner-id
138+
Values:
139+
- '057448758665'
140+
client_config: *aws_config
141+
142+
cloudify_manager_ami:
143+
type: cloudify.nodes.aws.ec2.Image
144+
properties:
145+
resource_config:
146+
kwargs:
147+
Filters:
148+
- Name: name
149+
Values:
150+
- Cloudify-Manager-4.1.1
151+
- Name: owner-id
152+
Values:
153+
- '263721492972'
154+
client_config: *aws_config
155+
156+
ubuntu_trusty_ami:
157+
type: cloudify.nodes.aws.ec2.Image
158+
properties:
159+
resource_config:
160+
kwargs:
161+
Filters:
162+
- Name: name
163+
Values:
164+
- 'ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-20170727'
165+
- Name: owner-id
166+
Values:
167+
- '099720109477'
168+
client_config: *aws_config
169+
134170
manager_key:
135171
type: cloudify.keys.nodes.RSAKey
136172
properties:
@@ -220,7 +256,7 @@ node_templates:
220256
domain: vpc
221257
relationships:
222258
- type: cloudify.relationships.depends_on
223-
target: subnet1
259+
target: subnet0
224260

225261
nat_gateway:
226262
type: cloudify.nodes.aws.ec2.NATGateway
@@ -364,14 +400,15 @@ node_templates:
364400
agent_config:
365401
install_method: none
366402
user: { get_input: cloudify_image_username }
367-
image_id: { get_input: cloudify_ami }
403+
image_id: ''
368404
instance_type: { get_input: cloudify_instance_type }
369405
interfaces:
370406
cloudify.interfaces.lifecycle:
371407
create:
372408
implementation: aws.cloudify_aws.ec2.instance.create
373409
inputs:
374410
args:
411+
image_id: { get_input: cloudify_manager_ami }
375412
block_device_map: { get_input: cloudify_host_block_device_mapping }
376413
placement: { get_input: availability_zone }
377414
user_data: { get_attribute: [ cloudify_host_cloud_config, cloud_config ] }
@@ -380,6 +417,12 @@ node_templates:
380417
target: cloudify_host_cloud_config
381418
- type: cloudify.aws.relationships.instance_connected_to_eni
382419
target: subnet0_nic0
420+
- type: cloudify.relationships.depends_on
421+
target: cloudify_manager_ami
422+
- type: cloudify.relationships.depends_on
423+
target: centos_core_ami
424+
- type: cloudify.relationships.depends_on
425+
target: ubuntu_trusty_ami
383426

384427
outputs:
385428

0 commit comments

Comments
 (0)