forked from cloudify-community/eaas-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-blueprint.yaml
181 lines (166 loc) · 6.26 KB
/
azure-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
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
- ttyd/ttyd.yaml
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:
resource_config:
type: resource_config
cloud_credentials:
type: dict
data_types:
resource_config:
properties:
rg_deployment_id:
type: string
resource_prefix:
type: string
azure_location_name:
type: string
vm_size:
type: string
image:
type: dict
node_templates:
rg_deployment:
type: cloudify.nodes.SharedResource
properties:
resource_config:
deployment:
id: { get_input: [ resource_config, rg_deployment_id ] }
resource_group:
type: cloudify.azure.nodes.ResourceGroup
properties:
use_external_resource: true
client_config: *azure_config
location: { get_input: [ resource_config, azure_location_name ] }
name: { get_attribute: [ rg_deployment, capabilities, rg_id ] }
relationships:
- type: cloudify.relationships.depends_on
target: rg_deployment
network:
type: cloudify.azure.nodes.network.VirtualNetwork
properties:
use_external_resource: true
client_config: *azure_config
location: { get_input: [ resource_config, azure_location_name ] }
name: { get_attribute: [ rg_deployment, capabilities, vn_id ] }
relationships:
- type: cloudify.azure.relationships.contained_in_resource_group
target: resource_group
subnet_1:
type: cloudify.azure.nodes.network.Subnet
properties:
use_external_resource: true
client_config: *azure_config
location: { get_input: [ resource_config, azure_location_name ] }
name: { get_attribute: [ rg_deployment, capabilities, subnet_ids, 0 ] }
relationships:
- type: cloudify.azure.relationships.contained_in_virtual_network
target: network
agents_security_group:
type: cloudify.azure.nodes.network.NetworkSecurityGroup
properties:
use_external_resource: true
client_config: *azure_config
location: { get_input: [ resource_config, azure_location_name ] }
name: { get_attribute: [ rg_deployment, capabilities, agents_security_group_id ] }
relationships:
- type: cloudify.azure.relationships.contained_in_virtual_network
target: network
storage_account:
type: cloudify.azure.nodes.storage.StorageAccount
properties:
use_external_resource: true
client_config: *azure_config
name: { get_attribute: [ rg_deployment, capabilities, sa_id ] }
location: { get_input: [ resource_config, azure_location_name ] }
relationships:
- type: cloudify.azure.relationships.contained_in_resource_group
target: resource_group
vm:
type: cloudify.azure.nodes.compute.VirtualMachine
properties:
client_config: *azure_config
name: { concat: [ { get_input: [ resource_config, resource_prefix ] }, '-vm' ] }
agent_config:
install_method: none
use_public_ip: true
os_family: linux
retry_after: 60
location: { get_input: [ resource_config, azure_location_name ] }
storage_endpoint: core.windows.net
resource_config:
hardwareProfile:
vmSize: { get_input: [ resource_config, vm_size ] }
storageProfile:
imageReference: { get_input: [ resource_config, image ] }
osProfile:
adminUsername: centos
linuxConfiguration:
ssh:
publicKeys:
- keydata: { get_input: [ cloud_credentials, public_key_content ] }
path: '/home/centos/.ssh/authorized_keys'
disablePasswordAuthentication: true
relationships:
- type: cloudify.azure.relationships.contained_in_resource_group
target: resource_group
- type: cloudify.azure.relationships.connected_to_storage_account
target: storage_account
- type: cloudify.azure.relationships.connected_to_nic
target: nic
nic:
type: cloudify.azure.nodes.network.NetworkInterfaceCard
properties:
location: { get_input: [ resource_config, azure_location_name ] }
name: { concat: [ { get_input: [ resource_config, resource_prefix ] }, '-nic' ] }
client_config: *azure_config
retry_after: 5
primary: true
relationships:
- type: cloudify.azure.relationships.contained_in_resource_group
target: resource_group
- type: cloudify.azure.relationships.nic_connected_to_network_security_group
target: agents_security_group
- type: cloudify.azure.relationships.nic_connected_to_ip_configuration
target: ip
ip:
type: cloudify.azure.nodes.network.IPConfiguration
properties:
location: { get_input: [ resource_config, azure_location_name ] }
name: { concat: [ { get_input: [ resource_config, resource_prefix ] }, '-ip' ] }
client_config: *azure_config
retry_after: 5
resource_config:
privateIPAllocationMethod: Dynamic
relationships:
- type: cloudify.azure.relationships.contained_in_resource_group
target: resource_group
- type: cloudify.azure.relationships.ip_configuration_connected_to_subnet
target: subnet_1
- type: cloudify.azure.relationships.ip_configuration_connected_to_public_ip
target: public_ip
public_ip:
type: cloudify.azure.nodes.network.PublicIPAddress
properties:
client_config: *azure_config
name: { concat: [ { get_input: [ resource_config, resource_prefix ] }, '-public-ip' ] }
location: { get_input: [ resource_config, azure_location_name ] }
tags:
Name: { concat: [ { get_input: [ resource_config, resource_prefix ] }, '-public-ip' ] }
retry_after: 5
resource_config:
publicIPAllocationMethod: Static
relationships:
- type: cloudify.azure.relationships.contained_in_resource_group
target: resource_group
capabilities:
vm_ip:
value: { get_attribute: [ vm, ip ] }