forked from cloudify-community/eaas-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-blueprint.yaml
79 lines (71 loc) · 2.75 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
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
network_deployment_id:
type: string
data_types:
resource_config:
properties:
master_username:
type: string
node_templates:
network:
type: cloudify.nodes.SharedResource
properties:
resource_config:
deployment:
id: { get_input: network_deployment_id }
password_generator:
type: cloudify.nodes.Root
interfaces:
cloudify.interfaces.lifecycle:
create:
executor: central_deployment_agent
implementation: scripts/generate-password.sh
database_deployment:
type: cloudify.azure.Deployment
properties:
client_config: *azure_config
location: { get_input: [ cloud_credentials, region_name ] }
resource_group_name: { concat: [{ get_attribute: [ network, capabilities, resource_prefix ] }, 'rg'] }
name: { concat: [{ get_attribute: [ network, capabilities, resource_prefix ] }, '-postgres'] }
params:
location: { get_input: [ cloud_credentials, region_name ] }
serverName: { concat: [ { get_attribute: [ network, capabilities, resource_prefix ] }, '-postgresql-server' ] }
administratorLogin: { get_input: [ resource_config, master_username ] }
administratorLoginPassword: { get_attribute: [ password_generator, master_password ] }
subnetName: { get_attribute: [ network, capabilities, private_subnet_ids, 0 ] }
virtualNetworkRuleName: "AllowSubnet"
skuCapacity: 2
skuName: "GP_Gen5_2"
skuSizeMB: 51200
skuTier: "GeneralPurpose"
skuFamily: "Gen5"
postgresqlVersion: "11"
backupRetentionDays: 7
geoRedundantBackup: "Disabled"
template_file: 'templates/db_arm.json'
relationships:
- target: network
type: cloudify.relationships.depends_on
- target: password_generator
type: cloudify.relationships.depends_on
capabilities:
host:
value: { concat: [ { get_attribute: [ network, capabilities, resource_prefix ] }, '-postgresql-server.postgres.database.azure.com' ] }
master_username:
value: { get_input: [ resource_config, master_username ] }
master_password:
value: { get_attribute: [ password_generator, master_password] }