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

Commit ec7197b

Browse files
author
earthmant
committed
adding aws tagging
1 parent 2dc1d35 commit ec7197b

File tree

1 file changed

+74
-20
lines changed

1 file changed

+74
-20
lines changed

aws.yaml

+74-20
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ tosca_definitions_version: cloudify_dsl_1_3
22

33
imports:
44
- https://cloudify.co/spec/cloudify/4.5/types.yaml
5-
- https://cloudify.co/spec/awssdk-plugin/2.6.0/plugin.yaml
5+
- https://cloudify.co/spec/awssdk-plugin/2.7.0/plugin.yaml
66
- https://cloudify.co/spec/utilities-plugin/1.9.5/plugin.yaml
77
- https://cloudify.co/spec/fabric-plugin/1.5.1/plugin.yaml
88
- imports/manager-configuration.yaml
@@ -95,6 +95,11 @@ inputs:
9595
private_subnet_cidr:
9696
default: 10.10.5.0/24
9797

98+
resource_name:
99+
type: string
100+
description: This will be the "Name" tag on your resource.
101+
default: "Cloudify"
102+
98103
dsl_definitions:
99104

100105
client_config: &client_config
@@ -164,14 +169,36 @@ node_templates:
164169
inputs:
165170
store_private_key_material: true
166171

172+
cloudify_host_cloud_config:
173+
type: cloudify.nodes.CloudInit.CloudConfig
174+
interfaces:
175+
cloudify.interfaces.lifecycle:
176+
create:
177+
inputs:
178+
resource_config:
179+
users:
180+
- name: { get_input: cloudify_image_username }
181+
primary-group: wheel
182+
shell: /bin/bash
183+
sudo: ['ALL=(ALL) NOPASSWD:ALL']
184+
ssh-authorized-keys:
185+
- { get_attribute: [ manager_key, public_key_export ] }
186+
relationships:
187+
- type: cloudify.relationships.depends_on
188+
target: manager_key
189+
167190
vpc:
168191
type: cloudify.nodes.aws.ec2.Vpc
169192
properties:
170193
resource_config:
171194
kwargs:
172195
CidrBlock: { get_input: vpc_cidr }
173196
client_config: *client_config
174-
197+
Tags:
198+
- Key: Name
199+
Value: { concat: [ { get_input: resource_name }, _vpc ] }
200+
- Key: Blueprint
201+
Value: cloudify-environment-setup
175202
internet_gateway:
176203
type: cloudify.nodes.aws.ec2.InternetGateway
177204
properties:
@@ -188,6 +215,11 @@ node_templates:
188215
CidrBlock: { get_input: public_subnet_cidr }
189216
AvailabilityZone: { get_input: availability_zone }
190217
client_config: *client_config
218+
Tags:
219+
- Key: Name
220+
Value: { concat: [ { get_input: resource_name }, _public_subnet ] }
221+
- Key: Blueprint
222+
Value: cloudify-environment-setup
191223
relationships:
192224
- type: cloudify.relationships.depends_on
193225
target: vpc
@@ -202,6 +234,11 @@ node_templates:
202234
CidrBlock: { get_input: private_subnet_cidr }
203235
AvailabilityZone: { get_input: availability_zone }
204236
client_config: *client_config
237+
Tags:
238+
- Key: Name
239+
Value: { concat: [ { get_input: resource_name }, _private_subnet ] }
240+
- Key: Blueprint
241+
Value: cloudify-environment-setup
205242
relationships:
206243
- type: cloudify.relationships.depends_on
207244
target: vpc
@@ -212,6 +249,11 @@ node_templates:
212249
type: cloudify.nodes.aws.ec2.RouteTable
213250
properties:
214251
client_config: *client_config
252+
Tags:
253+
- Key: Name
254+
Value: { concat: [ { get_input: resource_name }, _public_subnet_routetable ] }
255+
- Key: Blueprint
256+
Value: cloudify-environment-setup
215257
relationships:
216258
- type: cloudify.relationships.contained_in
217259
target: vpc
@@ -222,6 +264,11 @@ node_templates:
222264
type: cloudify.nodes.aws.ec2.RouteTable
223265
properties:
224266
client_config: *client_config
267+
Tags:
268+
- Key: Name
269+
Value: { concat: [ { get_input: resource_name }, _private_subnet_routetable ] }
270+
- Key: Blueprint
271+
Value: cloudify-environment-setup
225272
relationships:
226273
- type: cloudify.relationships.contained_in
227274
target: vpc
@@ -259,6 +306,11 @@ node_templates:
259306
type: cloudify.nodes.aws.ec2.NATGateway
260307
properties:
261308
client_config: *client_config
309+
Tags:
310+
- Key: Name
311+
Value: { concat: [ { get_input: resource_name }, _nat_gateway ] }
312+
- Key: Blueprint
313+
Value: cloudify-environment-setup
262314
relationships:
263315
- type: cloudify.relationships.depends_on
264316
target: public_subnet
@@ -372,6 +424,11 @@ node_templates:
372424
Description: Created by simple-infrastructure-blueprint aws.yaml.
373425
VpcId: { get_attribute: [ vpc, aws_resource_id] }
374426
client_config: *client_config
427+
Tags:
428+
- Key: Name
429+
Value: { concat: [ { get_input: resource_name }, _sec_group ] }
430+
- Key: Blueprint
431+
Value: cloudify-environment-setup
375432
relationships:
376433
- type: cloudify.relationships.depends_on
377434
target: vpc
@@ -381,24 +438,6 @@ node_templates:
381438
inputs:
382439
resource_config: { get_property: [ SELF, resource_config, kwargs] }
383440

384-
cloudify_host_cloud_config:
385-
type: cloudify.nodes.CloudInit.CloudConfig
386-
interfaces:
387-
cloudify.interfaces.lifecycle:
388-
create:
389-
inputs:
390-
resource_config:
391-
users:
392-
- name: { get_input: cloudify_image_username }
393-
primary-group: wheel
394-
shell: /bin/bash
395-
sudo: ['ALL=(ALL) NOPASSWD:ALL']
396-
ssh-authorized-keys:
397-
- { get_attribute: [ manager_key, public_key_export ] }
398-
relationships:
399-
- type: cloudify.relationships.depends_on
400-
target: manager_key
401-
402441
nic:
403442
type: cloudify.nodes.aws.ec2.Interface
404443
properties:
@@ -409,6 +448,11 @@ node_templates:
409448
SubnetId: { get_attribute: [ public_subnet, aws_resource_id] }
410449
Groups:
411450
- { get_attribute: [ security_group, aws_resource_id ] }
451+
Tags:
452+
- Key: Name
453+
Value: { concat: [ { get_input: resource_name }, _nic ] }
454+
- Key: Blueprint
455+
Value: cloudify-environment-setup
412456
relationships:
413457
- type: cloudify.relationships.depends_on
414458
target: public_subnet
@@ -436,6 +480,11 @@ node_templates:
436480
- Key: Name
437481
Value: Cloudify Volume
438482
client_config: *client_config
483+
Tags:
484+
- Key: Name
485+
Value: { concat: [ { get_input: resource_name }, _cloudify_host_volume ] }
486+
- Key: Blueprint
487+
Value: cloudify-environment-setup
439488

440489
cloudify_host:
441490
type: cloudify.nodes.aws.ec2.Instances
@@ -456,6 +505,11 @@ node_templates:
456505
AvailabilityZone: { get_input: availability_zone }
457506
UserData: { get_attribute: [ cloudify_host_cloud_config, cloud_config ] }
458507
client_config: *client_config
508+
Tags:
509+
- Key: Name
510+
Value: { concat: [ { get_input: resource_name }, _cloudify_host ] }
511+
- Key: Blueprint
512+
Value: cloudify-environment-setup
459513
relationships:
460514
- type: cloudify.relationships.depends_on
461515
target: cloudify_host_cloud_config

0 commit comments

Comments
 (0)