(context)
return {
      'resources': resources,
      'outputs': [{
          'name': 'ip',
          'value': '$(ref.internal-lb.ip)'
      }]
  }
Generate Deployment Manager configuration.

  Args:
    context: The context object provided by Deployment Manager.

  Returns:
    A config object for Deployment Manager (basically a dict with resources).
Generate Deployment Manager configuration.
Generate Deployment Manager configuration .
def GenerateConfig(context):
  """Generate Deployment Manager configuration.

  Args:
    context: The context object provided by Deployment Manager.

  Returns:
    A config object for Deployment Manager (basically a dict with resources).
  """

  region = context.properties['region']
  prefix = region + '-' + context.env['deployment']

  network_name = prefix + '-network'
  subnet_name = prefix + '-subnetwork'

  network_ref = '$(ref.{}.selfLink)'.format(network_name)
  subnet_ref = '$(ref.{}.selfLink)'.format(subnet_name)

  # Basic network, firewall rules, and load balancer
  resources = [{
      'name': network_name,
      'type': 'compute.v1.network',
      'properties': {
          'autoCreateSubnetworks': False,
      }
  }, {
      'name': subnet_name,
      'type': 'compute.v1.subnetwork',
      'properties': {
          'region': region,
          'privateIpGoogleAccess': False,
          'ipCidrRange': '10.128.0.0/20',
          'network': network_ref,
      }
  }, {
      'name': prefix + '-allow-internal-traffic-firewall-rule',
      'type': 'compute.v1.firewall',
      'properties': {
          'network':
              network_ref,
          'sourceRanges': ['10.128.0.0/20'],
          'allowed': [{
              'IPProtocol': 'tcp',
              'ports': ['22']
          }, {
              'IPProtocol': 'tcp',
              'ports': ['3389']
          }, {
              'IPProtocol': 'icmp',
          }],
          'direction':
              'INGRESS',
          'priority':
              1000,
      }
  }, {
      'name': 'internal-lb',
      'type': 'internal_lb.py',
      'properties': {
          'network': network_ref,
          'subnet': subnet_ref,
          'instance-groups': '$(ref.test-service.instance-groups)',
          'instance-tag': '$(ref.test-service.instance-tag)',
          'region': region,
      }
  }]

  resources += TestingResources(network_ref, subnet_ref, region,
                                context.properties['zones'])

  return {
      'resources': resources,
      'outputs': [{
          'name': 'ip',
          'value': '$(ref.internal-lb.ip)'
      }]
  }
def GenerateConfig ( context ) : region = context . properties [ 'region' ] prefix = region + '-' + context . env [ 'deployment' ] network_name = prefix + '-network' subnet_name = prefix + '-subnetwork' network_ref = '$(ref.{}.selfLink)' . format ( network_name ) subnet_ref = '$(ref.{}.selfLink)' . format ( subnet_name ) # Basic network, firewall rules, and load balancer resources = [ { 'name' : network_name , 'type' : 'compute.v1.network' , 'properties' : { 'autoCreateSubnetworks' : False , } } , { 'name' : subnet_name , 'type' : 'compute.v1.subnetwork' , 'properties' : { 'region' : region , 'privateIpGoogleAccess' : False , 'ipCidrRange' : '10.128.0.0/20' , 'network' : network_ref , } } , { 'name' : prefix + '-allow-internal-traffic-firewall-rule' , 'type' : 'compute.v1.firewall' , 'properties' : { 'network' : network_ref , 'sourceRanges' : [ '10.128.0.0/20' ] , 'allowed' : [ { 'IPProtocol' : 'tcp' , 'ports' : [ '22' ] } , { 'IPProtocol' : 'tcp' , 'ports' : [ '3389' ] } , { 'IPProtocol' : 'icmp' , } ] , 'direction' : 'INGRESS' , 'priority' : 1000 , } } , { 'name' : 'internal-lb' , 'type' : 'internal_lb.py' , 'properties' : { 'network' : network_ref , 'subnet' : subnet_ref , 'instance-groups' : '$(ref.test-service.instance-groups)' , 'instance-tag' : '$(ref.test-service.instance-tag)' , 'region' : region , } } ] resources += TestingResources ( network_ref , subnet_ref , region , context . properties [ 'zones' ] ) return { 'resources' : resources , 'outputs' : [ { 'name' : 'ip' , 'value' : '$(ref.internal-lb.ip)' } ] }