|
| 1 | +tosca_definitions_version: cloudify_dsl_1_3 |
| 2 | + |
| 3 | +description: > |
| 4 | + Create an GCP Example Network. |
| 5 | +
|
| 6 | +imports: |
| 7 | + - http://www.getcloudify.org/spec/cloudify/4.2/types.yaml |
| 8 | + - http://www.getcloudify.org/spec/gcp-plugin/1.4.0/plugin.yaml |
| 9 | + |
| 10 | +inputs: |
| 11 | + |
| 12 | + client_x509_cert_url: |
| 13 | + type: string |
| 14 | + default: { get_secret: gcp_client_x509_cert_url } |
| 15 | + |
| 16 | + client_email: |
| 17 | + type: string |
| 18 | + default: { get_secret: gcp_client_email } |
| 19 | + |
| 20 | + client_id: |
| 21 | + type: string |
| 22 | + default: { get_secret: gcp_client_id } |
| 23 | + |
| 24 | + project_id: |
| 25 | + type: string |
| 26 | + default: { get_secret: gcp_project_id } |
| 27 | + |
| 28 | + private_key_id: |
| 29 | + type: string |
| 30 | + default: { get_secret: gcp_private_key_id } |
| 31 | + |
| 32 | + private_key: |
| 33 | + type: string |
| 34 | + default: { get_secret: gcp_private_key } |
| 35 | + |
| 36 | + zone: |
| 37 | + default: { get_secret: gcp_zone } |
| 38 | + |
| 39 | + region: |
| 40 | + default: { get_secret: gcp_region } |
| 41 | + |
| 42 | + public_subnet_cidr: |
| 43 | + default: 10.11.12.0/22 |
| 44 | + |
| 45 | + private_subnet_cidr: |
| 46 | + default: 10.11.16.0/22 |
| 47 | + |
| 48 | + resource_prefix: |
| 49 | + default: cfy |
| 50 | + |
| 51 | + resource_suffix: |
| 52 | + default: 1 |
| 53 | + |
| 54 | + secrets: |
| 55 | + description: > |
| 56 | + key, value pairs of secrets used in AWS blueprint examples. |
| 57 | + default: |
| 58 | + - key: client_x509_cert_url |
| 59 | + value: { get_input: client_x509_cert_url } |
| 60 | + - key: client_email |
| 61 | + value: { get_input: client_email } |
| 62 | + - key: client_id |
| 63 | + value: { get_input: client_id } |
| 64 | + - key: project_id |
| 65 | + value: { get_input: project_id } |
| 66 | + - key: private_key_id |
| 67 | + value: { get_input: private_key_id } |
| 68 | + - key: private_key |
| 69 | + value: { get_input: private_key } |
| 70 | + - key: management_network_name |
| 71 | + value: { get_property: [ network, name ] } |
| 72 | + - key: zone |
| 73 | + value: { get_input: zone } |
| 74 | + - key: region |
| 75 | + value: { get_input: region } |
| 76 | + - key: management_subnetwork_name |
| 77 | + value: { get_property: [ public_subnet, name ] } |
| 78 | + - key: private_subnetwork_name |
| 79 | + value: { get_property: [ private_subnet, name ] } |
| 80 | + - key: ubuntu_trusty_image |
| 81 | + value: { get_input: ubuntu_trusty_image } |
| 82 | + - key: centos_core_image |
| 83 | + value: { get_input: centos_core_image } |
| 84 | + - key: small_instance_type |
| 85 | + value: { get_input: small_instance_type } |
| 86 | + - key: agent_key_public |
| 87 | + value: { get_attribute: [ manager_key, public_key_export ] } |
| 88 | + - key: agent_key_private |
| 89 | + value: { get_attribute: [ manager_key, private_key_export ] } |
| 90 | + |
| 91 | +dsl_definitions: |
| 92 | + |
| 93 | + client_config: &client_config |
| 94 | + auth: |
| 95 | + type: service_account |
| 96 | + auth_uri: https://accounts.google.com/o/oauth2/auth |
| 97 | + token_uri: https://accounts.google.com/o/oauth2/token |
| 98 | + auth_provider_x509_cert_url: https://www.googleapis.com/oauth2/v1/certs |
| 99 | + client_x509_cert_url: { get_input: client_x509_cert_url } |
| 100 | + client_email: { get_input: client_email } |
| 101 | + client_id: { get_input: client_id } |
| 102 | + project_id: { get_input: project_id } |
| 103 | + private_key_id: { get_input: private_key_id } |
| 104 | + private_key: { get_input: private_key } |
| 105 | + project: { get_input: project_id } |
| 106 | + zone: { get_input: zone } |
| 107 | + |
| 108 | +node_templates: |
| 109 | + |
| 110 | + network: |
| 111 | + type: cloudify.gcp.nodes.Network |
| 112 | + properties: |
| 113 | + gcp_config: *client_config |
| 114 | + name: { concat: [ { get_input: resource_prefix }, 'network', { get_input: resource_suffix } ] } |
| 115 | + auto_subnets: false |
| 116 | + |
| 117 | + public_subnet: |
| 118 | + type: cloudify.gcp.nodes.SubNetwork |
| 119 | + properties: |
| 120 | + gcp_config: *client_config |
| 121 | + name: { concat: [ { get_input: resource_prefix }, 'public_subnet', { get_input: resource_suffix } ] } |
| 122 | + subnet: { get_input: public_subnet_cidr } |
| 123 | + region: { get_input: region } |
| 124 | + relationships: |
| 125 | + - type: cloudify.gcp.relationships.contained_in_network |
| 126 | + target: network |
| 127 | + |
| 128 | + private_subnet: |
| 129 | + type: cloudify.gcp.nodes.SubNetwork |
| 130 | + properties: |
| 131 | + gcp_config: *client_config |
| 132 | + name: { concat: [ { get_input: resource_prefix }, 'private_subnet', { get_input: resource_suffix } ] } |
| 133 | + subnet: { get_input: private_subnet_cidr } |
| 134 | + region: { get_input: region } |
| 135 | + relationships: |
| 136 | + - type: cloudify.gcp.relationships.contained_in_network |
| 137 | + target: network |
| 138 | + |
| 139 | +outputs: |
| 140 | + |
| 141 | + network: |
| 142 | + value: { get_property: [ network, name ] } |
| 143 | + |
| 144 | + public_subnet: |
| 145 | + value: { get_property: [ public_subnet, name ] } |
| 146 | + |
| 147 | + private_subnet: |
| 148 | + value: { get_property: [ private_subnet, name ] } |
| 149 | + |
| 150 | + zone: |
| 151 | + value: { get_input: zone } |
| 152 | + |
| 153 | + region: |
| 154 | + value: { get_input: region } |
0 commit comments