forked from cloudify-community/eaas-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblueprint.yaml
264 lines (247 loc) · 8.88 KB
/
blueprint.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
tosca_definitions_version: cloudify_dsl_1_3
imports:
- https://cloudify.co/spec/cloudify/6.2.0/types.yaml
- plugin:cloudify-azure-plugin?version= >=3.0.10
dsl_definitions:
client_config: &azure_config
subscription_id: { get_input: [ cloud_credentials, azure_subscription_id ] }
tenant_id: { get_input: [ cloud_credentials, azure_tenant_id ] }
client_id: { get_input: [ cloud_credentials, azure_client_id ] }
client_secret: { get_input: [ cloud_credentials, azure_client_secret ] }
inputs:
cloud_credentials:
type: dict
resource_config:
type: resource_config
data_types:
resource_config:
properties:
name:
type: string
azure_location_name:
type: string
cidr_block:
type: string
default: 10.0.0.0/16
subnet_1_cidr:
type: string
default: 10.0.0.0/23
subnet_2_cidr:
type: string
default: 10.0.2.0/23
rg_tags:
type: dict
default:
Name: { get_input: [ resource_config, name ] }
vn_tags:
type: dict
default:
Name: { concat: [ { get_input: [ resource_config, name ] }, '-vnet' ] }
subnet_1_tags:
type: dict
default:
Name: { concat: [ { get_input: [ resource_config, name ] }, '-subnet-1' ] }
subnet_2_tags:
type: dict
default:
Name: { concat: [ { get_input: [ resource_config, name ] }, '-subnet-2' ] }
node_templates:
resource_group:
type: cloudify.azure.nodes.ResourceGroup
properties:
client_config: *azure_config
name: { get_input: [ resource_config, name ] }
location: { get_input: [ resource_config, azure_location_name ] }
tags: { get_input: [ resource_config, rg_tags ] }
network:
type: cloudify.azure.nodes.network.VirtualNetwork
properties:
client_config: *azure_config
name: { concat: [ { get_input: [ resource_config, name ] }, '-vnet' ] }
location: { get_input: [ resource_config, azure_location_name ] }
tags: { get_input: [ resource_config, vn_tags ] }
resource_config:
addressSpace:
addressPrefixes:
- { get_input: [ resource_config, cidr_block ] }
retry_after: 5
relationships:
- type: cloudify.azure.relationships.contained_in_resource_group
target: resource_group
subnet_1:
type: cloudify.azure.nodes.network.Subnet
properties:
client_config: *azure_config
name: { concat: [ { get_input: [ resource_config, name ] }, '-subnet-1' ] }
location: { get_input: [ resource_config, azure_location_name ] }
tags: { get_input: [ resource_config, subnet_1_tags ] }
retry_after: 5
resource_config:
addressPrefix: { get_input: [ resource_config, subnet_1_cidr ] }
relationships:
- type: cloudify.azure.relationships.contained_in_virtual_network
target: network
subnet_2:
type: cloudify.azure.nodes.network.Subnet
properties:
client_config: *azure_config
name: { concat: [ { get_input: [ resource_config, name ] }, '-subnet-2' ] }
location: { get_input: [ resource_config, azure_location_name ] }
tags: { get_input: [ resource_config, subnet_2_tags ] }
retry_after: 5
resource_config:
addressPrefix: { get_input: [ resource_config, subnet_2_cidr ] }
relationships:
- type: cloudify.azure.relationships.contained_in_virtual_network
target: network
- type: cloudify.relationships.depends_on
target: subnet_1
agents_security_group:
type: cloudify.azure.nodes.network.NetworkSecurityGroup
properties:
client_config: *azure_config
name: { concat: [ { get_input: [ resource_config, name ] } , '-cfy-agents' ] }
location: { get_input: [ resource_config, azure_location_name ] }
retry_after: 5
relationships:
- type: cloudify.azure.relationships.contained_in_virtual_network
target: network
- type: cloudify.relationships.depends_on
target: subnet_2
agents_security_group_allow_ssh:
type: cloudify.azure.nodes.network.NetworkSecurityRule
properties:
client_config: *azure_config
name: { concat: [ { get_input: [ resource_config, name ] } , '-cfy-agents-allow-ssh' ] }
location: { get_input: [ resource_config, azure_location_name ] }
retry_after: 5
resource_config:
description: SSH access
protocol: Tcp
sourcePortRange: '*'
destinationPortRange: 22
sourceAddressPrefix: '*'
destinationAddressPrefix: '*'
priority: 100
access: Allow
direction: Inbound
relationships:
- type: cloudify.azure.relationships.contained_in_network_security_group
target: agents_security_group
agents_security_group_allow_s3:
type: cloudify.azure.nodes.network.NetworkSecurityRule
properties:
client_config: *azure_config
name: { concat: [ { get_input: [ resource_config, name ] } , '-cfy-agents-allow-s3' ] }
location: { get_input: [ resource_config, azure_location_name ] }
retry_after: 5
resource_config:
description: S3 access
protocol: Tcp
sourcePortRange: '*'
destinationPortRange: 9000
sourceAddressPrefix: '*'
destinationAddressPrefix: '*'
priority: 103
access: Allow
direction: Inbound
relationships:
- type: cloudify.azure.relationships.contained_in_network_security_group
target: agents_security_group
agents_security_group_allow_ttyd:
type: cloudify.azure.nodes.network.NetworkSecurityRule
properties:
client_config: *azure_config
name: { concat: [ { get_input: [ resource_config, name ] } , '-cfy-agents-allow-ttyd' ] }
location: { get_input: [ resource_config, azure_location_name ] }
retry_after: 5
resource_config:
description: ttyd access
protocol: Tcp
sourcePortRange: '*'
destinationPortRange: 7681
sourceAddressPrefix: '*'
destinationAddressPrefix: '*'
priority: 104
access: Allow
direction: Inbound
relationships:
- type: cloudify.azure.relationships.contained_in_network_security_group
target: agents_security_group
agents_security_group_allow_minikube:
type: cloudify.azure.nodes.network.NetworkSecurityRule
properties:
client_config: *azure_config
name: { concat: [ { get_input: [ resource_config, name ] } , '-cfy-agents-allow-minikube' ] }
location: { get_input: [ resource_config, azure_location_name ] }
retry_after: 5
resource_config:
description: minikube access
protocol: Tcp
sourcePortRange: '*'
destinationPortRange: 8443
sourceAddressPrefix: '*'
destinationAddressPrefix: '*'
priority: 105
access: Allow
direction: Inbound
relationships:
- type: cloudify.azure.relationships.contained_in_network_security_group
target: agents_security_group
agents_security_group_allow_service:
type: cloudify.azure.nodes.network.NetworkSecurityRule
properties:
client_config: *azure_config
name: { concat: [ { get_input: [ resource_config, name ] } , '-cfy-agents-allow-service' ] }
location: { get_input: [ resource_config, azure_location_name ] }
retry_after: 5
resource_config:
description: nginx access
protocol: Tcp
sourcePortRange: '*'
destinationPortRange: 30080
sourceAddressPrefix: '*'
destinationAddressPrefix: '*'
priority: 106
access: Allow
direction: Inbound
relationships:
- type: cloudify.azure.relationships.contained_in_network_security_group
target: agents_security_group
storage_account:
type: cloudify.azure.nodes.storage.StorageAccount
properties:
client_config: *azure_config
name: { concat: [ { get_input: [ resource_config, name ] }, 'sa' ] }
location: { get_input: [ resource_config, azure_location_name ] }
resource_config:
accountType: Standard_LRS
relationships:
- type: cloudify.azure.relationships.contained_in_resource_group
target: resource_group
- type: cloudify.relationships.depends_on
target: network
capabilities:
rg_id:
description: |
Azure ID of the Resource Group
value: { get_attribute: [ resource_group, name ] }
vn_id:
description: |
Azure ID of the Virtual Network
value: { get_attribute: [ network, name ] }
subnet_ids:
description: |
Azure ID's of subnets
value:
- { get_attribute: [ subnet_1, name ] }
- { get_attribute: [ subnet_2, name ] }
agents_security_group_id:
description: |
Azure ID of a security group that allows Cloudify Manager to access
VM's via SSH
value: { get_attribute: [ agents_security_group, name ] }
sa_id:
description: |
Azure ID of the Storage Account
value: { get_attribute: [ storage_account, name ] }