|
| 1 | +tosca_definitions_version: cloudify_dsl_1_3 |
| 2 | + |
| 3 | +description: > |
| 4 | + Create an Example Azure Network. |
| 5 | +
|
| 6 | +imports: |
| 7 | + - http://www.getcloudify.org/spec/cloudify/4.2/types.yaml |
| 8 | + - http://www.getcloudify.org/spec/azure-plugin/1.5.1/plugin.yaml |
| 9 | + |
| 10 | +inputs: |
| 11 | + |
| 12 | + subscription_id: |
| 13 | + type: string |
| 14 | + default: { get_secret: azure_subscription_id } |
| 15 | + |
| 16 | + tenant_id: |
| 17 | + type: string |
| 18 | + default: { get_secret: azure_tenant_id } |
| 19 | + |
| 20 | + client_id: |
| 21 | + type: string |
| 22 | + default: { get_secret: azure_client_id } |
| 23 | + |
| 24 | + client_secret: |
| 25 | + type: string |
| 26 | + default: { get_secret: azure_client_secret } |
| 27 | + |
| 28 | + location: |
| 29 | + default: { get_secret: azure_location } |
| 30 | + |
| 31 | + retry_after: |
| 32 | + default: 5 |
| 33 | + |
| 34 | + resource_prefix: |
| 35 | + default: cfy |
| 36 | + |
| 37 | + resource_suffix: |
| 38 | + default: 0 |
| 39 | + |
| 40 | + public_subnet_cidr: |
| 41 | + default: 10.10.0.0/24 |
| 42 | + |
| 43 | + private_subnet_cidr: |
| 44 | + default: 10.10.1.0/24 |
| 45 | + |
| 46 | +dsl_definitions: |
| 47 | + |
| 48 | + client_config: &client_config |
| 49 | + subscription_id: { get_input: subscription_id } |
| 50 | + tenant_id: { get_input: tenant_id } |
| 51 | + client_id: { get_input: client_id } |
| 52 | + client_secret: { get_input: client_secret } |
| 53 | + |
| 54 | +node_templates: |
| 55 | + |
| 56 | + resource_group: |
| 57 | + type: cloudify.azure.nodes.ResourceGroup |
| 58 | + properties: |
| 59 | + azure_config: *client_config |
| 60 | + name: { concat: [ { get_input: resource_prefix }, 'resource_group', { get_input: resource_suffix } ] } |
| 61 | + location: { get_input: location } |
| 62 | + |
| 63 | + virtual_network: |
| 64 | + type: cloudify.azure.nodes.network.VirtualNetwork |
| 65 | + properties: |
| 66 | + azure_config: *client_config |
| 67 | + name: { concat: [ { get_input: resource_prefix }, 'vnet', { get_input: resource_suffix } ] } |
| 68 | + location: { get_input: location } |
| 69 | + retry_after: { get_input: retry_after } |
| 70 | + relationships: |
| 71 | + - type: cloudify.azure.relationships.contained_in_resource_group |
| 72 | + target: resource_group |
| 73 | + |
| 74 | + public_subnet: |
| 75 | + type: cloudify.azure.nodes.network.Subnet |
| 76 | + properties: |
| 77 | + azure_config: *client_config |
| 78 | + name: { concat: [ { get_input: resource_prefix }, 'public_subnet', { get_input: resource_suffix } ] } |
| 79 | + location: { get_input: location } |
| 80 | + retry_after: { get_input: retry_after } |
| 81 | + resource_config: |
| 82 | + addressPrefix: { get_input: public_subnet_cidr } |
| 83 | + relationships: |
| 84 | + - type: cloudify.azure.relationships.contained_in_virtual_network |
| 85 | + target: virtual_network |
| 86 | + |
| 87 | + private_subnet: |
| 88 | + type: cloudify.azure.nodes.network.Subnet |
| 89 | + properties: |
| 90 | + azure_config: *client_config |
| 91 | + name: { concat: [ { get_input: resource_prefix }, 'private_subnet', { get_input: resource_suffix } ] } |
| 92 | + location: { get_input: location } |
| 93 | + retry_after: { get_input: retry_after } |
| 94 | + resource_config: |
| 95 | + addressPrefix: { get_input: private_subnet_cidr } |
| 96 | + relationships: |
| 97 | + - type: cloudify.azure.relationships.contained_in_virtual_network |
| 98 | + target: virtual_network |
| 99 | + - type: cloudify.relationships.depends_on |
| 100 | + target: public_subnet |
| 101 | + |
| 102 | +outputs: |
| 103 | + |
| 104 | + resource_group: |
| 105 | + value: { get_attribute: [ resource_group, name ] } |
| 106 | + |
| 107 | + virtual_network: |
| 108 | + value: { get_attribute: [ virtual_network, name ] } |
| 109 | + |
| 110 | + public_subnet: |
| 111 | + value: { get_attribute: [ public_subnet, name ] } |
| 112 | + |
| 113 | + private_subnet: |
| 114 | + value: { get_attribute: [ private_subnet, name ] } |
| 115 | + |
| 116 | + location: |
| 117 | + value: { get_input: location } |
0 commit comments