(context)
return {
      'resources': [{
          'name': base_name,
          'type': 'compute.v1.instance',
          'properties': instance
          }]
      }
Generate configuration.
Generate configuration.
Generate configuration .
def GenerateConfig(context):
  """Generate configuration."""

  base_name = context.properties['instanceName']

  items = []
  for key, value in context.properties['metadata'].iteritems():
    items.append({
        'key': key,
        'value': value
        })
  metadata = {'items': items}

  # Properties for the container-based instance.
  instance = {
      'zone': context.properties['zone'],
      'machineType': ZonalComputeUrl(
          context.env['project'], context.properties['zone'], 'machineTypes',
          'f1-micro'),
      'metadata': metadata,
      'serviceAccounts': [{
          'email': 'default',
          'scopes': context.properties['scopes']
      }],
      'disks': [{
          'deviceName': 'boot',
          'type': 'PERSISTENT',
          'autoDelete': True,
          'boot': True,
          'initializeParams': {
              'diskName': base_name + '-disk',
              'sourceImage': GlobalComputeUrl(
                  'debian-cloud', 'images',
                  ''.join(['backports-debian', '-7-wheezy-v20151104']))
              },
          }],
      'networkInterfaces': [{
          'accessConfigs': [{
              'name': 'external-nat',
              'type': 'ONE_TO_ONE_NAT'
              }],
          'network': GlobalComputeUrl(
              context.env['project'], 'networks', 'default')
          }]
      }

  # Resources and output to return.
  return {
      'resources': [{
          'name': base_name,
          'type': 'compute.v1.instance',
          'properties': instance
          }]
      }
def GenerateConfig ( context ) : base_name = context . properties [ 'instanceName' ] items = [ ] for key , value in context . properties [ 'metadata' ] . iteritems ( ) : items . append ( { 'key' : key , 'value' : value } ) metadata = { 'items' : items } # Properties for the container-based instance. instance = { 'zone' : context . properties [ 'zone' ] , 'machineType' : ZonalComputeUrl ( context . env [ 'project' ] , context . properties [ 'zone' ] , 'machineTypes' , 'f1-micro' ) , 'metadata' : metadata , 'serviceAccounts' : [ { 'email' : 'default' , 'scopes' : context . properties [ 'scopes' ] } ] , 'disks' : [ { 'deviceName' : 'boot' , 'type' : 'PERSISTENT' , 'autoDelete' : True , 'boot' : True , 'initializeParams' : { 'diskName' : base_name + '-disk' , 'sourceImage' : GlobalComputeUrl ( 'debian-cloud' , 'images' , '' . join ( [ 'backports-debian' , '-7-wheezy-v20151104' ] ) ) } , } ] , 'networkInterfaces' : [ { 'accessConfigs' : [ { 'name' : 'external-nat' , 'type' : 'ONE_TO_ONE_NAT' } ] , 'network' : GlobalComputeUrl ( context . env [ 'project' ] , 'networks' , 'default' ) } ] } # Resources and output to return. return { 'resources' : [ { 'name' : base_name , 'type' : 'compute.v1.instance' , 'properties' : instance } ] }